Skip to content

Commit

Permalink
Added check to see if menu link is set in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Apr 13, 2016
1 parent 0664bd5 commit 46527f7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions libraries/cms/installer/adapter.php
Expand Up @@ -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;
Expand Down

0 comments on commit 46527f7

Please sign in to comment.