CRM_Core_Config::customCSSURL - Don't tample empty values
authorCiviCRM <info@civicrm.org>
Mon, 21 Dec 2015 23:10:16 +0000 (15:10 -0800)
committerCiviCRM <info@civicrm.org>
Mon, 21 Dec 2015 23:27:36 +0000 (15:27 -0800)
Ex: The 4.4 upgrader checks `customCSSURL` and sets `disable_core_css`
depending on whether the value is empty.  Since the addTrailingSlash was
converting empty to '/', this caused bad upgrades.

CRM/Core/Config/MagicMerge.php

index 57bf9c9c0f311a65edb15b372649dcef8e3af082..884a65a25ded90ccf5494d092fe3a16acb6eef1e 100644 (file)
@@ -233,7 +233,10 @@ class CRM_Core_Config_MagicMerge {
       case 'setting-url-abs':
       case 'setting-url-rel':
         $type = (strstr($type, 'abs')) ? 'absolute' : 'relative';
-        $value = CRM_Utils_File::addTrailingSlash($this->getSettings()->get($name));
+        $value = $this->getSettings()->get($name);
+        if ($value) {
+          $value = CRM_Utils_File::addTrailingSlash($value);
+        }
         $this->cache[$k] = Civi::paths()->getUrl($value, $type);
         return $this->cache[$k];