diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc index 2182f4d..acc4ed4 100644 --- a/core/modules/language/language.negotiation.inc +++ b/core/modules/language/language.negotiation.inc @@ -486,6 +486,9 @@ function language_url_rewrite_url(&$path, &$options) { $options['base_url'] = str_replace('https://', 'http://', $options['base_url']); } } + + // Add Drupal's subfolder from the base_path if there is one. + $options['base_url'] .= rtrim(base_path(), '/'); } break; diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php index e929171..f71a866 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php @@ -454,7 +454,7 @@ function testLanguageDomain() { $this->drupalPost('admin/config/regional/language/detection/url', $edit, t('Save configuration')); // Build the link we're going to test. - $link = 'it.example.com/admin'; + $link = 'it.example.com' . rtrim(base_path(), '/') . '/admin'; // Test URL in another language: http://it.example.com/admin. // Base path gives problems on the testbot, so $correct_link is hard-coded. diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php index 3effed4..bea5dc1 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php @@ -136,7 +136,7 @@ function testDomainNameNegotiationPort() { 'language' => $language, )); - $expected = $index_php ? 'http://example.fr:88/index.php/' : 'http://example.fr:88/'; + $expected = ($index_php ? 'http://example.fr:88/index.php' : 'http://example.fr:88') . rtrim(base_path(), '/') . '/'; $this->assertEqual($url, $expected, 'The right port is used.'); @@ -147,7 +147,7 @@ function testDomainNameNegotiationPort() { 'base_url' => $GLOBALS['base_url'] . ':90', )); - $expected = $index_php ? 'http://example.fr:90/index.php/' : 'http://example.fr:90/'; + $expected = $index_php ? 'http://example.fr:90/index.php' : 'http://example.fr:90' . rtrim(base_path(), '/') . '/'; $this->assertEqual($url, $expected, 'A given port is not overriden.');