summaryrefslogtreecommitdiff
path: root/program/lib/Net/Socket.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-22 19:19:29 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-22 19:19:29 +0200
commitc71281fd44d900032e4a3be19e663993d9b9a0ea (patch)
treed3244f1c359ae5db8045b499a87b70dff76c331c /program/lib/Net/Socket.php
parentc16bd50947e0712385d9f4729fd23b6aef76308a (diff)
Fix warning when using IP address as hostname in Net_Socket
Diffstat (limited to 'program/lib/Net/Socket.php')
-rw-r--r--program/lib/Net/Socket.php2
1 files changed, 1 insertions, 1 deletions
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);
}