diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-03 09:59:43 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-03 09:59:43 +0000 |
commit | a4b3217bd1760611fc3616e293542a21375bd2ff (patch) | |
tree | 744fbe4a8437dc991614de22944f87e5d62cd469 /includes/bootstrap.inc | |
parent | b5331d08591afbb2b46e709cc424591a9c093466 (diff) | |
download | brdo-a4b3217bd1760611fc3616e293542a21375bd2ff.tar.gz brdo-a4b3217bd1760611fc3616e293542a21375bd2ff.tar.bz2 |
#169263 by Gerhard Killesreiter: fix IP address identification
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r-- | includes/bootstrap.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 2d9034abb..bcf94f7ea 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1111,8 +1111,9 @@ function ip_address() { if (!isset($ip_address)) { $ip_address = $_SERVER['REMOTE_ADDR']; if (variable_get('reverse_proxy', 0) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { - // If there are several arguments, the leftmost one is the farthest client - list($ip_address, ) = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); + // If there are several arguments, we need to check the most + // recently added one, ie the last one. + $ip_address = array_pop(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])); } } |