Skip to content

Commit

Permalink
Fix ActiveChecker: use fullUrl for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
AMoktar committed Dec 3, 2023
1 parent ea0d9e2 commit 732fc2a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Menu/ActiveChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,10 @@ protected function checkPattern($pattern)
return (bool) preg_match($regex, $this->request->path());
}

// If pattern is not a regex, check if the requested url matches the
// absolute path to the given pattern. When the pattern uses query
// parameters, compare with the full url request.
// If pattern is not a regex, check if the requested url matches the full url request.

$pattern = preg_replace('@^https?://@', '*', $this->url->to($pattern));
$request = $this->request->url();

if (isset(parse_url($pattern)['query'])) {
$request = $this->request->fullUrl();
}
$request = $this->request->fullUrl();

return Str::is(trim($pattern), trim($request));
}
Expand Down

0 comments on commit 732fc2a

Please sign in to comment.