Skip to content

Commit

Permalink
Checking for Itemid, option and optionally lang
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Mar 6, 2015
1 parent 310950f commit b3eef81
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libraries/cms/router/site.php
Expand Up @@ -578,13 +578,18 @@ protected function processParseRules(&$uri, $stage = self::PROCESS_DURING)
*/
protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING)
{
if ($stage == self::PROCESS_BEFORE)
if ($stage == self::PROCESS_DURING)
{
// Make sure any menu vars are used if no others are specified
if (($this->_mode != JROUTER_MODE_SEF) && $uri->getVar('Itemid') && count($uri->getQuery(true)) == 2)
$query = $uri->getQuery(true);
if ($this->_mode != 1
&& isset($query['Itemid'])
&& isset($query['option'])
&& (count($query) == 2 || (count($query) == 3 && isset($query['lang']))))
{
// Get the active menu item
$itemid = $uri->getVar('Itemid');
$lang = $uri->getVar('lang');
$item = $this->menu->getItem($itemid);

if ($item)
Expand All @@ -593,6 +598,11 @@ protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING)
}

$uri->setVar('Itemid', $itemid);

if ($lang)
{
$uri->setVar('lang', $lang);
}
}
}

Expand Down

0 comments on commit b3eef81

Please sign in to comment.