From d6402ea3796a6c8075b53a7b7415e0e2429646d7 Mon Sep 17 00:00:00 2001 From: Nicolas Ganivet Date: Tue, 1 Mar 2016 13:00:37 -0700 Subject: [PATCH] CRM-18130: Custom CSS URL not working if aliased or rewritten --- CRM/Utils/System/DrupalBase.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index b2c1274a72..0a51ba7d81 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -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) { -- 2.25.1