/**
* Define the threshold for the ids reactions.
+ * @var array
*/
private $threshold = [
'log' => 25,
'filter_type' => 'xml',
'filter_path' => "{$civicrm_root}/packages/IDS/default_filter.xml",
'tmp_path' => $tmpDir,
- 'HTML_Purifier_Path' => $civicrm_root . '/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php',
+ 'HTML_Purifier_Path' => $civicrm_root . 'packages/IDS/vendors/htmlpurifer/HTMLPurifier.auto.php',
'HTML_Purifier_Cache' => $tmpDir,
'scan_keys' => '',
'exceptions' => ['__utmz', '__utmc'],
* @return bool
*/
private function log($result, $reaction = 0) {
- $ip = (isset($_SERVER['SERVER_ADDR']) &&
- $_SERVER['SERVER_ADDR'] != '127.0.0.1') ? $_SERVER['SERVER_ADDR'] : (
- isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '127.0.0.1'
- );
+ // Include X_FORWARD_FOR ip address if set as per IDS patten.
+ $ip = $_SERVER['REMOTE_ADDR'] . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? ' (' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ')' : '');
$data = [];
$session = CRM_Core_Session::singleton();