Skip to content
Snippets Groups Projects
Commit 355c54ff authored by catch's avatar catch
Browse files

Issue #3156883 by alexpott, longwave: \Drupal\Core\Url ensure fragment is not an empty string

(cherry picked from commit d3f654b0)
parent dec18fa7
No related branches found
No related tags found
No related merge requests found
......@@ -297,7 +297,7 @@ public static function fromUri($uri, $options = []) {
// Extract query parameters and fragment and merge them into $uri_options,
// but preserve the original $options for the fallback case.
$uri_options = $options;
if (isset($uri_parts['fragment'])) {
if (isset($uri_parts['fragment']) && $uri_parts['fragment'] !== '') {
$uri_options += ['fragment' => $uri_parts['fragment']];
unset($uri_parts['fragment']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment