Merge pull request #22581 from lemniscus/feature/issue-3037/two-digit-year-import
[civicrm-core.git] / CRM / Core / IDS.php
index 59e48c24a6f082105011306f71f4bca5f22a4478..fb8a01974a9e2ecf9a617d70d05b69f0c447cd3e 100644 (file)
@@ -110,7 +110,8 @@ class CRM_Core_IDS {
         'filter_type' => 'xml',
         'filter_path' => "{$pkgs}/IDS/default_filter.xml",
         'tmp_path' => $tmpDir,
-        'HTML_Purifier_Path' => $pkgs . '/IDS/vendors/htmlpurifier/HTMLPurifier.auto.php',
+        // Ignored, uses autoloader
+        'HTML_Purifier_Path' => TRUE,
         'HTML_Purifier_Cache' => $tmpDir,
         'scan_keys' => '',
         'exceptions' => ['__utmz', '__utmc'],
@@ -225,7 +226,7 @@ class CRM_Core_IDS {
   /**
    * This function writes an entry about the intrusion to the database.
    *
-   * @param array $result
+   * @param IDS_Report $result
    * @param int $reaction
    *
    * @return bool
@@ -236,13 +237,14 @@ class CRM_Core_IDS {
 
     $data = [];
     $session = CRM_Core_Session::singleton();
+    $session_id = CRM_Core_Config::singleton()->userSystem->getSessionId() ? CRM_Core_Config::singleton()->userSystem->getSessionId() : '0';
     foreach ($result as $event) {
       $data[] = [
         'name' => $event->getName(),
         'value' => stripslashes($event->getValue()),
         'page' => $_SERVER['REQUEST_URI'],
         'userid' => $session->get('userID'),
-        'session' => session_id() ? session_id() : '0',
+        'session' => $session_id,
         'ip' => $ip,
         'reaction' => $reaction,
         'impact' => $result->getImpact(),