diff options
author | Andreas Gohr <andi@splitbrain.org> | 2011-02-06 12:44:16 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2011-02-06 12:44:16 +0100 |
commit | 2343a762fb62ebed6ef140bca2d8b5aa4fa2983d (patch) | |
tree | 902f0345e2aa739bebb35f9f7a0da0daa61de1a3 /inc | |
parent | c34c77725873a495f375a815dd89be723cd2a512 (diff) | |
download | rpg-2343a762fb62ebed6ef140bca2d8b5aa4fa2983d.tar.gz rpg-2343a762fb62ebed6ef140bca2d8b5aa4fa2983d.tar.bz2 |
handle link local and localhost IPv6 addresses in clientIP FS#2138
Diffstat (limited to 'inc')
-rw-r--r-- | inc/common.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php index eab5f1129..23d9c7155 100644 --- a/inc/common.php +++ b/inc/common.php @@ -639,7 +639,7 @@ function clientIP($single=false){ // decide which IP to use, trying to avoid local addresses $ip = array_reverse($ip); foreach($ip as $i){ - if(preg_match('/^(127\.|10\.|192\.168\.|172\.((1[6-9])|(2[0-9])|(3[0-1]))\.)/',$i)){ + if(preg_match('/^(::1|[fF][eE]80:|127\.|10\.|192\.168\.|172\.((1[6-9])|(2[0-9])|(3[0-1]))\.)/',$i)){ continue; }else{ return $i; |