From c71281fd44d900032e4a3be19e663993d9b9a0ea Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 22 May 2013 19:19:29 +0200 Subject: [PATCH] Fix warning when using IP address as hostname in Net_Socket --- program/lib/Net/Socket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/lib/Net/Socket.php b/program/lib/Net/Socket.php index 669700c1d..e67411124 100644 --- a/program/lib/Net/Socket.php +++ b/program/lib/Net/Socket.php @@ -124,7 +124,7 @@ class Net_Socket extends PEAR return $this->raiseError('$addr cannot be empty'); } elseif (strspn($addr, ':.0123456789') == strlen($addr) || strstr($addr, '/') !== false) { - $this->addr = substr($addr, ':') ? '['.$addr.']' : $addr; + $this->addr = strpos($addr, ':') !== false ? '['.$addr.']' : $addr; } else { $this->addr = @gethostbyname($addr); }