Skip to content

Commit

Permalink
Add additional check that view exists before proceeding
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tonypartridge committed Nov 20, 2017
1 parent 5e8ea37 commit 8303e8f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/com_content/helpers/legacyrouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ 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['view'] == $query['view']
&& isset($menuItem->query['id'], $query['id'])
&& $menuItem->query['id'] == (int) $query['id'])
Expand Down

0 comments on commit 8303e8f

Please sign in to comment.