Skip to content

Commit

Permalink
Add additional check that view exists before proceeding (#18757)
Browse files Browse the repository at this point in the history
* Add additional check that view exists before proceeding

We assume the array key exists with view but not ID. I have come across some installations where view does not exist and it causes php warnings. So just check it does exist before actually proceeding further as we do with ID.

* Update legacyrouter.php

* Update legacyrouter.php
  • Loading branch information
tonypartridge authored and Michael Babker committed Jun 2, 2018
1 parent 58cd2dc commit b67d16f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/com_content/helpers/legacyrouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public function build(&$query, &$segments)

// Are we dealing with an article or category that is attached to a menu item?
if ($menuItem !== null
&& isset($menuItem->query['view'], $query['view'], $menuItem->query['id'], $query['id'])
&& $menuItem->query['view'] == $query['view']
&& isset($menuItem->query['id'], $query['id'])
&& $menuItem->query['id'] == (int) $query['id'])
{
unset($query['view']);
Expand Down

0 comments on commit b67d16f

Please sign in to comment.