From 46527f7be865f09e1cc9ae02407d220f292785cc Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 13 Apr 2016 08:24:59 +0100 Subject: [PATCH] Added check to see if menu link is set in manifest --- libraries/cms/installer/adapter.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/libraries/cms/installer/adapter.php b/libraries/cms/installer/adapter.php index 38ada6de750e5..ded09904d3029 100644 --- a/libraries/cms/installer/adapter.php +++ b/libraries/cms/installer/adapter.php @@ -528,19 +528,22 @@ public function getManifest() */ public function getMenuLinkOption() { - // Ensure the link is a string - $link = (string) $this->getManifest()->administration->menu->attributes()->link; + // Check if the link attribute is set + if (isset ($this->getManifest()->administration->menu->attributes()->link)) + { + // Esnure the link is a string + $link = (string)$this->getManifest()->administration->menu->attributes()->link; - $delimiter = 'option='; + $delimiter = 'option='; - // Checks delimiter is in the link string - if (strpos($link, $delimiter) !== false) - { - // Gets the option from the link attribute - $option = substr($link, strpos($link, $delimiter) + strlen($delimiter)); + // Checks delimiter is in the link string + if (strpos($link, $delimiter) !== false) { + // Gets the option from the link attribute + $option = substr($link, strpos($link, $delimiter) + strlen($delimiter)); - // Filter the option for illegal characters - $option = JFilterInput::getInstance()->clean($option, 'string'); + // Filter the option for illegal characters + $option = JFilterInput::getInstance()->clean($option, 'string'); + } } return $option;