Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.4
-
Fix Version/s: 4.5
-
Component/s: Drupal Integration Modules
-
Labels:
Description
On a Drupal multilingual site if the "Language Domain" setting of the current Drupal locale contains the protocol then the function languageNegotiationURL in CRM_Utils_System_Drupal.php duplicates it.
In other words for an input $url = "https://domain.com" and $language->domain = "https://domain.com" it will return "https://https://domain.com"
From some tutorials I found on setting up Drupal locales it seems to be valid to input the "Language Domain" with the protocol included. Therefore CiviCRM should handle this case.
My fix for this was around line 869 of CRM_Utils_System_Drupal.php
- $url = (CRM_Utils_System::isSSL() ? 'https' : 'http') . '://' . $language->domain . base_path();
+ $cleaned_domain = preg_replace('#^https?://#', '', $language->domain);
+ $url = (CRM_Utils_System::isSSL() ? 'https' : 'http') . '://' . $cleaned_domain . base_path();
Perhaps using parse_url on the $language->domain; would work as well.
This function exists in the D6 version as well but doesn't seem to have the same portion for domain based language negotiation.