Skip to content

Commit

Permalink
bug #21104 [FrameworkBundle] fix IPv6 address handling in server comm…
Browse files Browse the repository at this point in the history
…ands (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
  • Loading branch information
nicolas-grekas committed Jan 12, 2017
2 parents 4769ca2 + 2bb4713 commit d7bc68a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php
Expand Up @@ -54,7 +54,9 @@ protected function isOtherServerProcessRunning($address)
return true;
}

list($hostname, $port) = explode(':', $address);
$pos = strrpos($address, ':');
$hostname = substr($address, 0, $pos);
$port = substr($address, $pos + 1);

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

Expand Down

0 comments on commit d7bc68a

Please sign in to comment.