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

Drupal locale url langauge negotiation causes all forward slashes to be stripped from profile image URLs in the baseURL path

    Details

      Description

      I've located the source of the problem: civicrm/CRM/Contact/BAO/contact.php

      if ( module_exists('locale') && $mode = variable_get( 'language_negotiation', LANGUAGE_NEGOTIATION_NONE ) ) {
      global $language;
      if( isset( $language->prefix ) )

      { $baseUrl= str_replace( $language->prefix.'/', '', $config->userFrameworkBaseURL ); }

      }

      on line 772.

      The str_replace here is supposed to strip out the additional forward slash but when using the default language the is not prefix so the the str_replace ends up stripping all the forward slashes from the baseURL resulting in an image url of http:www.mydomain.comsites/default/files/civicrm...

      Changing line 771 to:
      if( isset( $language->prefix ) && $language->prefix != '' ) {
      fixes the problem but as I am not php expert I'm wanted to check whether this is the correct way to go about it.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              painsworth Peter Ainsworth
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: