X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FSystem%2FDrupalBase.php;h=3129073181edf76306eb345afad7d17624305e22;hb=97f643ccac726d7da37f5983aa4c6c9132c8e872;hp=923994fbfadcb27d17f2fe703d3dc050bfbf4314;hpb=e1deb4df7d47f5b546215eeb484223607bade976;p=civicrm-core.git diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index 923994fbfa..3129073181 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | + | Copyright CiviCRM LLC (c) 2004-2016 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2015 + * @copyright CiviCRM LLC (c) 2004-2016 * $Id$ * */ @@ -100,8 +100,12 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { // compares $url (which is some unknown/untrusted value from a third-party dev) to the CMS's base url (which is independent of civi's url) // to see if the url is within our drupal dir, if it is we are able to treated it as an internal url if (strpos($url, $base_url) === 0) { - $internal = TRUE; - $url = trim(str_replace($base_url, '', $url), '/'); + $file = trim(str_replace($base_url, '', $url), '/'); + // CRM-18130: Custom CSS URL not working if aliased or rewritten + if (file_exists(DRUPAL_ROOT . $file)) { + $url = $file; + $internal = TRUE; + } } // Handle relative urls that are within the CiviCRM module directory elseif (strpos($url, $base) === 0) { @@ -248,7 +252,7 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { 'cms:view user account', )) ) { - return CRM_Utils_System::url('user/' . $uid); + return url('user/' . $uid); }; }