summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2011-02-06 12:44:16 +0100
committerAndreas Gohr <andi@splitbrain.org>2011-02-06 12:44:16 +0100
commit2343a762fb62ebed6ef140bca2d8b5aa4fa2983d (patch)
tree902f0345e2aa739bebb35f9f7a0da0daa61de1a3 /inc/common.php
parentc34c77725873a495f375a815dd89be723cd2a512 (diff)
downloadrpg-2343a762fb62ebed6ef140bca2d8b5aa4fa2983d.tar.gz
rpg-2343a762fb62ebed6ef140bca2d8b5aa4fa2983d.tar.bz2
handle link local and localhost IPv6 addresses in clientIP FS#2138
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php2
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;