From b67d16f74638bf5bfd96d31989bfcfdfa2491400 Mon Sep 17 00:00:00 2001 From: Tony Partridge Date: Sat, 2 Jun 2018 16:34:22 +0100 Subject: [PATCH] Add additional check that view exists before proceeding (#18757) * 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 --- components/com_content/helpers/legacyrouter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_content/helpers/legacyrouter.php b/components/com_content/helpers/legacyrouter.php index 5b2dc90e03907..ac1d9b76cc106 100644 --- a/components/com_content/helpers/legacyrouter.php +++ b/components/com_content/helpers/legacyrouter.php @@ -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']);