8000 Fixed IPv6 Check in RequestMatcher · Ouark/symfony@959c1df · GitHub
[go: up one dir, main page]

Skip to content

Commit 959c1df

Browse files
yohangfabpot
authored andcommitted
Fixed IPv6 Check in RequestMatcher
Added a fallback check for ipv6 support even if sockets extension is not available
1 parent f19e4b5 commit 959c1df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/RequestMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function checkIp4($requestIp, $ip)
154154
*/
155155
protected function checkIp6($requestIp, $ip)
156156
{
157-
if (!defined('AF_INET6')) {
157+
if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) {
158158
throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
159159
}
160160

0 commit comments

Comments
 (0)
0