Commit d4acf8de 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 52e82dab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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']);
    }