diff --git a/core/lib/Drupal/Core/Path/PathValidator.php b/core/lib/Drupal/Core/Path/PathValidator.php index 53f22dd..6a7f5c3 100644 --- a/core/lib/Drupal/Core/Path/PathValidator.php +++ b/core/lib/Drupal/Core/Path/PathValidator.php @@ -103,7 +103,7 @@ public function getUrlIfValid($path) { } $request = Request::create((substr($path, 0, 1) == '/' ? '' : '/') . $path); - $attributes = $this->getPathAttributes(preg_replace('@^/@', '', $path), $request); + $attributes = $this->getPathAttributes(ltrim($path, '/'), $request); if (!$attributes) { return FALSE;