diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index a9a9e1a..5a58722 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -83,6 +83,8 @@ public function __construct(RouteProviderInterface $provider, OutboundPathProces $this->pathProcessor = $path_processor; $this->routeProcessor = $route_processor; + // Ensure to have a safe fallback. This is also needed for some tests, which + // don't specify the filter protocols container parameter. UrlHelper::setAllowedProtocols($filter_protocols ?: ['http', 'https']); $this->requestStack = $request_stack; } diff --git a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php index 550e1a4..b9e729a 100644 --- a/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php +++ b/core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php @@ -46,6 +46,8 @@ class UnroutedUrlAssembler implements UnroutedUrlAssemblerInterface { * An array of protocols allowed for URL generation. */ public function __construct(RequestStack $request_stack, OutboundPathProcessorInterface $path_processor, $filter_protocols = []) { + // Ensure to have a safe fallback. This is also needed for some tests, which + // don't specify the filter protocols container parameter. UrlHelper::setAllowedProtocols($filter_protocols ?: ['http', 'https']); $this->requestStack = $request_stack; $this->pathProcessor = $path_processor;