From 551a720fb682ca7e0a6ab3c7c5befb0430cef341 Mon Sep 17 00:00:00 2001 From: Michael Klier Date: Tue, 22 Jan 2008 18:55:35 +0100 Subject: gethostsbyaddrs() must check if only one IP was supplied darcs-hash:20080122175535-23886-a6e9a9170bf23ebe460cccdbb06f97206d1d98eb.gz --- inc/common.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'inc/common.php') 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);; } /** -- cgit v1.2.3