8000 bug #15706 [framework-bundle] Added support for the `0.0.0.0/0` trust… · symfony/symfony@81605dd · GitHub
[go: up one dir, main page]

Skip to content

Commit 81605dd

Browse files
committed
bug #15706 [framework-bundle] Added support for the 0.0.0.0/0 trusted proxy (zerkms)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15706). Discussion ---------- [framework-bundle] Added support for the `0.0.0.0/0` trusted proxy | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT It is relevant to my other PR: #14690 The original intention was to start accepting `0.0.0.0/0` as a trusted proxy (which is a valid CIDR notation). The prupose is to allow all requests to be treated as trusted and to eliminate using dirty `['0.0.0.0/1', '128.0.0.0/1']` workaround. Commits ------- 3188e1b Added support for the `0.0.0.0/0` trusted proxy
2 parents 8059dc1 + 3188e1b commit 81605dd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function getConfigTreeBuilder()
5252
}
5353

5454
if (false !== strpos($v, '/')) {
55+
if ('0.0.0.0/0' === $v) {
56+
return false;
57+
}
58+
5559
list($v, $mask) = explode('/', $v, 2);
5660

5761
if (strcmp($mask, (int) $mask) || $mask < 1 || $mask > (false !== strpos($v, ':') ? 128 : 32)) {

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getTestValidTrustedProxiesData()
6666
array(array(), array()),
6767
array(array('10.0.0.0/8'), array('10.0.0.0/8')),
6868
array(array('::ffff:0:0/96'), array('::ffff:0:0/96')),
69+
array(array('0.0.0.0/0'), array('0.0.0.0/0')),
6970
);
7071
}
7172

0 commit comments

Comments
 (0)
0