Skip to content

Commit 4a0b309

Browse files
committed
fix IPv6 address handling in server commands
1 parent 6ea81a8 commit 4a0b309

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Command/ServerCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ protected function isOtherServerProcessRunning($address)
5454
return true;
5555
}
5656

57-
list($hostname, $port) = explode(':', $address);
57+
$pos = strrpos($address, ':');
58+
$hostname = substr($address, 0, $pos);
59+
$port = substr($address, $pos + 1);
5860

5961
$fp = @fsockopen($hostname, $port, $errno, $errstr, 5);
6062

0 commit comments

Comments
 (0)