Added support for the 0.0.0.0/0 trusted proxy

This commit is contained in:
Ivan Kurnosov 2015-09-07 19:21:10 +12:00 committed by Fabien Potencier
parent 8059dc1bab
commit 3188e1b5d2
2 changed files with 5 additions and 0 deletions

View File

@ -52,6 +52,10 @@ class Configuration implements ConfigurationInterface
}
if (false !== strpos($v, '/')) {
if ('0.0.0.0/0' === $v) {
return false;
}
list($v, $mask) = explode('/', $v, 2);
if (strcmp($mask, (int) $mask) || $mask < 1 || $mask > (false !== strpos($v, ':') ? 128 : 32)) {

View File

@ -66,6 +66,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
array(array(), array()),
array(array('10.0.0.0/8'), array('10.0.0.0/8')),
array(array('::ffff:0:0/96'), array('::ffff:0:0/96')),
array(array('0.0.0.0/0'), array('0.0.0.0/0')),
);
}