From d8a4f8ed8f4156505d58f7a478c8eececece47bc Mon Sep 17 00:00:00 2001
From: Mathieu Lutfy <mathieu@bidon.ca>
Date: Tue, 29 Oct 2013 15:48:15 -0400
Subject: [PATCH] CRM-13354: Fix support for locale detection from the domain
 (in Drupal), when the site is in a sub-directory (base_path() returns the
 subdirectory).

---
 CRM/Utils/System/Drupal.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php
index fda57c0385..692dbe48f8 100644
--- a/CRM/Utils/System/Drupal.php
+++ b/CRM/Utils/System/Drupal.php
@@ -958,7 +958,7 @@ AND    u.status = 1
         if ($urlType == LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX) {
           if (isset($language->prefix) && $language->prefix) {
             if ($addLanguagePart) {
-              $url .= $language->prefix . '/';
+              $url = (CRM_Utils_System::isSSL() ? 'https' : 'http') . '://' . $language->domain . base_path();
             }
             if ($removeLanguagePart) {
               $url = str_replace("/{$language->prefix}/", '/', $url);
-- 
2.25.1