Merge pull request #24059 from eileenmcnaughton/pledged
[civicrm-core.git] / CRM / Core / IDS.php
index 359ff77e5647f86ba33500dcb30ef0ab4044d3b6..fb8a01974a9e2ecf9a617d70d05b69f0c447cd3e 100644 (file)
@@ -226,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
@@ -237,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(),