diff options
author | Hans Duedal <hd@onlinecity.dk> | 2011-07-22 20:26:06 +0200 |
---|---|---|
committer | Hans Duedal <hd@onlinecity.dk> | 2011-07-22 20:26:06 +0200 |
commit | 4e530b92f567f35bb5527bf68521e34a6b5b9093 (patch) | |
tree | 053482511bdcbc9a97b9ed5b8bb7f05e8e03e9bb | |
parent | 3d1329a02f3f8bf08df4ddb4b7929d4574efed24 (diff) | |
download | php-smpp-4e530b92f567f35bb5527bf68521e34a6b5b9093.zip php-smpp-4e530b92f567f35bb5527bf68521e34a6b5b9093.tar.gz php-smpp-4e530b92f567f35bb5527bf68521e34a6b5b9093.tar.bz2 |
Fixed gethostbyname call, so it fails properly on unknown hosts
-rw-r--r-- | sockettransport.class.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sockettransport.class.php b/sockettransport.class.php index 572b4c4..6c2aef7 100644 --- a/sockettransport.class.php +++ b/sockettransport.class.php @@ -93,7 +93,7 @@ class SocketTransport } // also try gethostbyname, since name could also be something else, such as "localhost" etc. $ip = gethostbyname($hostname); - if (!in_array($ip,$ip4s)) $ip4s[] = $ip; + if ($ip != $hostname && !in_array($ip,$ip4s)) $ip4s[] = $ip; if ($this->debug) call_user_func($this->debugHandler, "IPv4 addresses for $hostname: ".implode(', ',$ip4s)); } } |