Issue #1826252 by Jeroen, benjf, wilco: Domain language negotiation broken when a base url is configured.
parent
3b61f06bf9
commit
010ffd4508
|
@ -155,6 +155,9 @@ class PathProcessorLanguage implements InboundPathProcessorInterface, OutboundPa
|
|||
$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(), '/');
|
||||
}
|
||||
}
|
||||
return $path;
|
||||
|
|
|
@ -455,7 +455,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
|
|||
$this->rebuildContainer();
|
||||
|
||||
// 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.
|
||||
|
|
|
@ -134,7 +134,8 @@ class LanguageUrlRewritingTest extends WebTestBase {
|
|||
'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.');
|
||||
|
||||
// If we set the port explicitly in url(), it should not be overriden.
|
||||
|
@ -144,7 +145,8 @@ class LanguageUrlRewritingTest extends WebTestBase {
|
|||
'base_url' => $request->getBaseUrl() . ':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.');
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue