Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7bc68a

Browse files
bug #21104 [FrameworkBundle] fix IPv6 address handling in server commands (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] fix IPv6 address handling in server commands | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21039 (comment) | License | MIT | Doc PR | This fixes #21039 (comment) as reported by @sstok for the existing commands by backporting @fabpot's patch from #21039. Commits ------- 2bb4713 fix IPv6 address handling in server commands
2 parents 4769ca2 + 2bb4713 commit d7bc68a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/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)