diff --git a/includes/locale.inc b/includes/locale.inc index c168da0..5af2cc3 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -457,6 +457,10 @@ function locale_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/modules/locale/locale.test b/modules/locale/locale.test index 9ffec9f..145c790 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -2514,7 +2514,7 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase { foreach (array('it', 'fr') as $langcode) { // Build the link we're going to test based on the clean URL setting. - $link = (!empty($GLOBALS['conf']['clean_url'])) ? $langcode . '.example.com/admin' : $langcode . '.example.com/?q=admin'; + $link = (!empty($GLOBALS['conf']['clean_url'])) ? $langcode . '.example.com' . rtrim(base_path(), '/') . '/admin' : $langcode . '.example.com/?q=admin'; // Test URL in another language. // Base path gives problems on the testbot, so $correct_link is hard-coded.