Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14489

If the "Language Domain" setting in the Drupal Locale contains the protocol the function languageNegotiationURL in CRM_Utils_System_Drupal.php duplicates it

    Details

      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.

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              lola_slade Lola Slade
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: