Skip to content

Commit 6fd85cb

Browse files
committed
Fix the URL generation for effectively empty query strings
`\http_build_query()` explicitly discards any component that has a `NULL` value. This can lead to an empty string being returned which was not handled previously.
1 parent 45539f1 commit 6fd85cb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wcfsetup/install/files/lib/system/request/route/DynamicRequestRoute.class.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ protected function buildRoute(array $components, $application, $useBuildSchema)
230230
}
231231

232232
if ($components !== []) {
233-
$link .= \str_contains($link, '?') ? '&' : '?';
234-
$link .= \http_build_query($components, '', '&');
233+
$queryString = \http_build_query($components, '', '&');
234+
if ($queryString !== '') {
235+
$link .= \str_contains($link, '?') ? '&' : '?';
236+
$link .= $queryString;
237+
}
235238
}
236239

237240
return $link;

0 commit comments

Comments
 (0)