summaryrefslogtreecommitdiff
path: root/program/lib/Net
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/Net')
-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);
}