diff --git a/core/includes/theme.inc b/core/includes/theme.inc index c66b1ae..6627118 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1316,7 +1316,7 @@ function template_preprocess_html(&$variables) { } else { $system_path = \Drupal::service('path.current')->getPath(); - $variables['root_path'] = explode('/', $system_path)[0]; + $variables['root_path'] = explode('/', $system_path)[1]; } $site_config = \Drupal::config('system.site'); diff --git a/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php index c64f98c..ec24484 100644 --- a/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php @@ -66,8 +66,7 @@ public function onKernelRequestConvertPath(GetResponseEvent $event) { $request = $event->getRequest(); $path = trim($request->getPathInfo(), '/'); $path = $this->pathProcessor->processInbound($path, $request); - $path = '/' . $path; - $this->currentPath->setPath($path, $request); + $this->currentPath->setPath('/' . $path, $request); // Set the cache key on the alias manager cache decorator. if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) { diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php index eaec9fe..58e390f 100644 --- a/core/lib/Drupal/Core/Routing/RouteProvider.php +++ b/core/lib/Drupal/Core/Routing/RouteProvider.php @@ -117,7 +117,7 @@ public function __construct(Connection $connection, RouteBuilderInterface $route public function getRouteCollectionForRequest(Request $request) { $path = $this->currentPath->getPath($request); - $collection = $this->getRoutesByPath($path); + $collection = $this->getRoutesByPath(rtrim($path, '/')); // Try rebuilding the router if it is necessary. if (!$collection->count() && $this->routeBuilder->rebuildIfNeeded()) {