CRM_Core_IDS - Fix loading with alternate packages path
authorTim Otten <totten@civicrm.org>
Wed, 15 Jan 2020 21:41:09 +0000 (13:41 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 28 Jan 2020 22:52:07 +0000 (14:52 -0800)
CRM/Core/IDS.php

index e72afd146f3921c1014eaa149f8779713648a287..7a3eded15af81fff272faf5805dc74788c901ba5 100644 (file)
@@ -103,14 +103,14 @@ class CRM_Core_IDS {
   public static function createBaseConfig() {
     $config = \CRM_Core_Config::singleton();
     $tmpDir = empty($config->uploadDir) ? Civi::paths()->getVariable('civicrm.compile', 'path') : $config->uploadDir;
-    global $civicrm_root;
+    $pkgs = Civi::paths()->getVariable('civicrm.packages', 'path');
 
     return [
       'General' => [
         'filter_type' => 'xml',
-        'filter_path' => "{$civicrm_root}/packages/IDS/default_filter.xml",
+        'filter_path' => "{$pkgs}/IDS/default_filter.xml",
         'tmp_path' => $tmpDir,
-        'HTML_Purifier_Path' => $civicrm_root . 'packages/IDS/vendors/htmlpurifier/HTMLPurifier.auto.php',
+        'HTML_Purifier_Path' => $pkgs . '/IDS/vendors/htmlpurifier/HTMLPurifier.auto.php',
         'HTML_Purifier_Cache' => $tmpDir,
         'scan_keys' => '',
         'exceptions' => ['__utmz', '__utmc'],