Skip to content

Commit

Permalink
Clear never accessed router code
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Jul 14, 2022
1 parent 7a69698 commit 9e8b90f
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/site/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,35 +233,21 @@ public function build(&$query)
$segments = [];

if ($view) {
// See if there is a menu for this view
$viewMenu = $this->helper->getMenuItemByQuery(
[
'view' => $view,
'id' => $id
]
);

if (is_object($viewMenu)) {
if ($viewMenu) {
if ($viewMenu->query['id'] == $id) {
$query = [
'option' => $query['option'],
'Itemid' => $viewMenu->id
];
$query['Itemid'] = $viewMenu->id;

if (empty($task)) {
return [];
}
}

} elseif (is_array($viewMenu) && isset($viewMenu[$id])) {
if ($viewMenu[$id]->query['id'] == $id) {
$query['Itemid'] = $viewMenu[$id]->id;

if (empty($task)) {
return $segments;
}
}

}
}

Expand Down

0 comments on commit 9e8b90f

Please sign in to comment.