Skip to content

Commit

Permalink
Work around parse_url() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 11, 2024
1 parent dc6de50 commit c0f8159
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Impersonate/ImpersonateUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private function buildExitPath(?string $targetUri = null): string
$targetUri = $request->getRequestUri();
}

$targetUri .= (parse_url($targetUri, \PHP_URL_QUERY) ? '&' : '?').http_build_query([$switchUserConfig['parameter'] => SwitchUserListener::EXIT_VALUE], '', '&');
$targetUri .= (str_contains($targetUri, '?') ? '&' : '?').http_build_query([$switchUserConfig['parameter'] => SwitchUserListener::EXIT_VALUE], '', '&');

return $targetUri;
}
Expand Down

0 comments on commit c0f8159

Please sign in to comment.