diff --git a/core/includes/file.inc b/core/includes/file.inc index 3c0e315..d0d39c1 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -310,7 +310,7 @@ function file_create_url($uri) { // If this is not a properly formatted stream, then it is a shipped file. // Therefore, return the urlencoded URI with the base URL prepended. $options = UrlHelper::parse($uri); - $path = \Drupal::service('app')->getBasePath() . '/' . UrlHelper::encodePath($options['path']); + $path = \Drupal::service('app')->getBaseUrl() . '/' . UrlHelper::encodePath($options['path']); // Append the query. if ($options['query']) { $path .= '?' . UrlHelper::buildQuery($options['query']); diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index c50e154..441a71a 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -466,7 +466,7 @@ public function preHandle(Request $request) { // Initialize legacy request globals. // @todo remove all occurencies. $GLOBALS['base_url'] = $app->getBaseUrl(); - $GLOBALS['base_path'] = $app->getBasePath(); + $GLOBALS['base_path'] = $app->getBasePath() . '/'; $GLOBALS['base_root'] = $request->getSchemeAndHttpHost(); // Put the request on the stack. diff --git a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php index 997bda2..eafa74d 100644 --- a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php +++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php @@ -183,7 +183,7 @@ public function processOutbound($path, &$options = array(), Request $request = N } // Add Drupal's subfolder from the base_path if there is one. - $options['base_url'] .= \Drupal::service('app')->getBaseUrl(); + $options['base_url'] .= \Drupal::service('app')->getBasePath(); if ($cacheable_metadata) { $cacheable_metadata->addCacheContexts(['languages:' . LanguageInterface::TYPE_URL, 'url.site']); }