Skip to content

Commit

Permalink
Include check for delimiter in link string
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Apr 12, 2016
1 parent 8759c17 commit 0664bd5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libraries/cms/installer/adapter.php
Expand Up @@ -531,14 +531,17 @@ public function getMenuLinkOption()
// Ensure the link is a string
$link = (string) $this->getManifest()->administration->menu->attributes()->link;

// Sets 'option=' as the delimiter
$delimiter = 'option=';

// 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 0664bd5

Please sign in to comment.