summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php')
-rw-r--r--core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php
index bc21ea8..2aed98e 100644
--- a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php
+++ b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php
@@ -113,6 +113,11 @@ class UnroutedUrlAssembler implements UnroutedUrlAssemblerInterface {
// https://www.drupal.org/node/2417459
$uri = substr($uri, 5);
+ // Strip leading slashes from internal paths to prevent them becoming
+ // external URLs without protocol. /example.com should not be turned into
+ // //example.com.
+ $uri = ltrim($uri, '/');
+
// Allow (outbound) path processing, if needed. A valid use case is the path
// alias overview form:
// @see \Drupal\path\Controller\PathController::adminOverview().