diff options
author | Michael Klier <chi@chimeric.de> | 2008-01-22 18:55:35 +0100 |
---|---|---|
committer | Michael Klier <chi@chimeric.de> | 2008-01-22 18:55:35 +0100 |
commit | 551a720fb682ca7e0a6ab3c7c5befb0430cef341 (patch) | |
tree | 7b4b79d53da5a0e1931b8638272652f93e26317e | |
parent | 29bfcd16ff6df2bbd7371cb73689464136bbe987 (diff) | |
download | rpg-551a720fb682ca7e0a6ab3c7c5befb0430cef341.tar.gz rpg-551a720fb682ca7e0a6ab3c7c5befb0430cef341.tar.bz2 |
gethostsbyaddrs() must check if only one IP was supplied
darcs-hash:20080122175535-23886-a6e9a9170bf23ebe460cccdbb06f97206d1d98eb.gz
-rw-r--r-- | inc/common.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/inc/common.php b/inc/common.php index 3a5839b5d..fea8322fe 100644 --- a/inc/common.php +++ b/inc/common.php @@ -585,10 +585,15 @@ function clientIP($single=false){ function gethostsbyaddrs($ips){ $hosts = array(); $ips = explode(',',$ips); - foreach($ip as $ip){ - $host[] = gethostbyaddr(trim($ip)); + + if(is_array($ips)) { + foreach($ip as $ip){ + $hosts[] = gethostbyaddr(trim($ip)); + } + return join(',',$hosts); + } else { + return gethostbyaddr(trim($ips)); } - return join(',',$host);; } /** |