From f3a27f08143ae295bad68c062b862f2008c8ba49 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Wed, 29 May 2013 10:56:43 -0700 Subject: [PATCH] CRM-12718 ---------------------------------------- * CRM-12718: in_array() expects parameter 2 to be array in IDS.php http://issues.civicrm.org/jira/browse/CRM-12718 --- CRM/Core/IDS.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index cfc0e62ffa..cbdeaa1ba8 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -254,10 +254,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 +275,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); } } -- 2.25.1