CRM-14897 - fix adminGroup for Cleanup Caches so it appears properly in admin console.
[civicrm-core.git] / CRM / Core / IDS.php
index cfc0e62ffa5d8f811189b20b6170363adb81d069..a6e68cf2f88ede0704fe202fcbc62360c2f9c277 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -205,7 +205,10 @@ class CRM_Core_IDS {
    * This function writes an entry about the intrusion
    * to the intrusion database
    *
-   * @param array $results
+   * @param $result
+   * @param int $reaction
+   *
+   * @internal param array $results
    *
    * @return boolean
    */
@@ -254,10 +257,16 @@ class CRM_Core_IDS {
     $session = CRM_Core_Session::singleton();
     $session->reset(2);
 
+    $msg = ts('There is a validation error with your HTML input. Your activity is a bit suspicious, hence aborting');
+
     $path = implode('/', $args);
-    if ($path == in_array("civicrm/ajax/rest", "civicrm/api/json")) {
-      require ("api/v3/utils.php");
-      $error = civicrm_api3_create_error(ts('There is a validation error with your HTML input. Your activity is a bit suspicious, hence aborting'),
+    if (in_array(
+        $path,
+        array("civicrm/ajax/rest", "civicrm/api/json")
+      )) {
+      require_once "api/v3/utils.php";
+      $error = civicrm_api3_create_error(
+        $msg,
         array(
           'IP' => $_SERVER['REMOTE_ADDR'],
           'error_code' => 'IDS_KICK',
@@ -269,7 +278,7 @@ class CRM_Core_IDS {
       echo json_encode($error);
       CRM_Utils_System::civiExit();
     }
-    CRM_Core_Error::fatal(ts('There is a validation error with your HTML input. Your activity is a bit suspicious, hence aborting'));
+    CRM_Core_Error::fatal($msg);
   }
 }