From 3afff2c43d37b685772c07ef110038a55cb15504 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 6 Oct 2014 16:35:11 +0200 Subject: [PATCH] check first that $_SERVER['REMOTE_ADDR'] exists and is not empty on tep_get_ip_address() function --- catalog/includes/functions/general.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/catalog/includes/functions/general.php b/catalog/includes/functions/general.php index 7a87c5167..621041f8c 100644 --- a/catalog/includes/functions/general.php +++ b/catalog/includes/functions/general.php @@ -1294,7 +1294,9 @@ function tep_get_ip_address() { $ip_addresses[] = $_SERVER['HTTP_PROXY_USER']; } - $ip_addresses[] = $_SERVER['REMOTE_ADDR']; + if ( isset($_SERVER['REMOTE_ADDR']) && !empty($_SERVER['REMOTE_ADDR']) ) { + $ip_addresses[] = $_SERVER['REMOTE_ADDR']; + } foreach ( $ip_addresses as $ip ) { if ( !empty($ip) && tep_validate_ip_address($ip) ) {