Skip to content

Commit 37fc36f

Browse files
committedFeb 12, 2025·
bug #6814 Fix warning when matching menu item URLs without path (javiereguiluz)
This PR was merged into the 4.x branch. Discussion ---------- Fix warning when matching menu item URLs without path Fixes #6813. Commits ------- d30df93 Fix warning when matching menu item URLs without path
2 parents 579731c + d30df93 commit 37fc36f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Menu/MenuItemMatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private function doMarkSelectedPrettyUrlsMenuItem(array $menuItems, Request $req
190190

191191
// remove host part from the menu item link URL
192192
$urlParts = parse_url($menuItemDto->getLinkUrl());
193-
$menuItemUrlWithoutHost = $urlParts['path'];
193+
$menuItemUrlWithoutHost = $urlParts['path'] ?? '';
194194
if (\array_key_exists('query', $urlParts)) {
195195
$menuItemUrlWithoutHost .= '?'.$urlParts['query'];
196196
}

0 commit comments

Comments
 (0)
Please sign in to comment.