Commit 010ffd45 authored by alexpott's avatar alexpott
Browse files

Issue #1826252 by Jeroen, benjf, wilco: Domain language negotiation broken...

Issue #1826252 by Jeroen, benjf, wilco: Domain language negotiation broken when a base url is configured.
parent 3b61f06b
......@@ -155,6 +155,9 @@ public function processOutbound($path, &$options = array(), Request $request = N
$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 @@ function testLanguageDomain() {
$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 @@ 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.');
// If we set the port explicitly in url(), it should not be overriden.
......@@ -144,7 +145,8 @@ function testDomainNameNegotiationPort() {
'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.');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment