Commit d4acf8de authored by catch's avatar catch

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

(cherry picked from commit d3f654b0)
parent 52e82dab
......@@ -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']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment