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

Skip to content

Commit 40bcd77

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: use brace-style regex delimiters Fixed typo RecursiveIterator -> RecursiveIteratorIterator [Validator] make phpdoc of ObjectInitializerInterface interface more accurate
2 parents 5aaa0d7 + c2cccaf commit 40bcd77

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/Symfony/Component/Form/Util/InheritDataAwareIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Contrary to \ArrayIterator, this iterator recognizes changes in the original
1818
* array during iteration.
1919
*
20-
* You can wrap the iterator into a {@link \RecursiveIterator} in order to
20+
* You can wrap the iterator into a {@link \RecursiveIteratorIterator} in order to
2121
* enter any child form that inherits its parent's data and iterate the children
2222
* of that form as well.
2323
*

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ public static function getTrustedHeaderSet()
641641
public static function setTrustedHosts(array $hostPatterns)
642642
{
643643
self::$trustedHostPatterns = array_map(function ($hostPattern) {
644-
return sprintf('#%s#i', $hostPattern);
644+
return sprintf('{%s}i', $hostPattern);
645645
}, $hostPatterns);
646646
// we need to reset trusted hosts on trusted host patterns change
647647
self::$trustedHosts = array();

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected function tearDown()
2323
{
2424
// reset
2525
Request::setTrustedProxies(array(), -1);
26+
Request::setTrustedHosts(array());
2627
}
2728

2829
public function testInitialize()
@@ -2007,9 +2008,15 @@ public function testTrustedHosts()
20072008

20082009
$request->headers->set('host', 'subdomain.trusted.com');
20092010
$this->assertEquals('subdomain.trusted.com', $request->getHost());
2011+
}
20102012

2011-
// reset request for following tests
2012-
Request::setTrustedHosts(array());
2013+
public function testSetTrustedHostsDoesNotBreakOnSpecialCharacters()
2014+
{
2015+
Request::setTrustedHosts(array('localhost(\.local){0,1}#,example.com', 'localhost'));
2016+
2017+
$request = Request::create('/');
2018+
$request->headers->set('host', 'localhost');
2019+
$this->assertSame('localhost', $request->getHost());
20132020
}
20142021

20152022
public function testFactory()

0 commit comments

Comments
 (0)