Update Core IP address to match IDS Pattern
* @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();