Skip to content

Commit

Permalink
Fix menu item matcher when using pretty URLs and submenus
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Karnauhov committed Dec 5, 2024
1 parent 7d6c711 commit beff6b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Menu/MenuItemMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ private function doMarkSelectedPrettyUrlsMenuItem(array $menuItems, Request $req

// compare the ending of the URL instead of a strict equality because link URLs can be absolute URLs
if (str_ends_with($menuItemUrl, $currentRequestUriWithoutQueryString)
|| str_ends_with($menuItemUrl, $currentRequestUriWithoutAction)
|| ('' !== $currentRequestUriWithoutAction && str_ends_with($menuItemUrl, $currentRequestUriWithoutAction))
|| str_ends_with($menuItemUrlWithoutQueryString, $currentRequestUriWithoutQueryString)
|| str_ends_with($menuItemUrlWithoutQueryString, $currentRequestUriWithoutAction)) {
|| ('' !== $currentRequestUriWithoutAction && str_ends_with($menuItemUrlWithoutQueryString, $currentRequestUriWithoutAction))) {
$menuItemDto->setSelected(true);

return $menuItems;
Expand Down

0 comments on commit beff6b7

Please sign in to comment.