From e2554a7257fe1f411e440654f3e3c1736caff394 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 24 May 2020 09:37:01 +0200 Subject: [PATCH] fix fragment uri bug --- Uri/UriFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index c4a5ca069..8bcc4e0e8 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -197,9 +197,9 @@ final class UriFactory $partCount = \count($parts); $fragment = ''; - if (($fragStart = \strripos($parts[0], '#')) !== false) { - $fragment = \substr($parts[0], $fragStart); - $parts[0] = \substr($parts[0], 0, $fragStart); + if (($fragStart = \strripos($parts[$partCount - 1], '#')) !== false) { + $fragment = \substr($parts[$partCount - 1], $fragStart); + $parts[$partCount - 1] = \substr($parts[$partCount - 1], 0, $fragStart); } if ($partCount > 1) {