fix bug with missing ? and multiple fragments

This commit is contained in:
Dennis Eichhorn 2020-12-19 20:29:52 +01:00
parent a392d44799
commit 7443963582

View File

@ -134,6 +134,11 @@ final class UriFactory
foreach ($data as $key => $value) {
self::setQuery('?' . $key, $value, true);
}
$data = $uri->fragments;
foreach ($data as $key => $value) {
self::setQuery('#' . $key, $value, true);
}
}
/**
@ -199,6 +204,10 @@ final class UriFactory
$url
);
if (\stripos($url, '?') === false && ($pos = \stripos($url, '&')) !== false) {
$url = \substr_replace($url, '?', $pos, 1);
}
/** @var array $urlStructure */
$urlStructure = \parse_url($url);
if ($urlStructure === false) {