8000 Merge branch '3.4' into 4.3 · symfony/symfony@d20f544 · GitHub
[go: up one dir, main page]

Skip to content

Commit d20f544

Browse files
Merge branch '3.4' into 4.3
* 3.4: [HttpFoundation] Allow redirecting to URLs that contain a semicolon
2 parents 3b237ce + 9e7c254 commit d20f544

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Symfony/Component/HttpFoundation/RedirectResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function setTargetUrl($url)
9393
<html>
9494
<head>
9595
<meta charset="UTF-8" />
96-
<meta http-equiv="refresh" content="0;url=%1$s" />
96+
<meta http-equiv="refresh" content="0;url=\'%1$s\'" />
9797
9898
<title>Redirecting to %1$s</title>
9999
</head>

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ public function testGenerateMetaRedirect()
2020
{
2121
$response = new RedirectResponse('foo.bar');
2222

23-
$this->assertEquals(1, preg_match(
24-
'#<meta http-equiv="refresh" content="\d+;url=foo\.bar" />#',
25-
preg_replace(['/\s+/', '/\'/'], [' ', '"'], $response->getContent())
26-
));
23+
$this->assertRegExp('#<meta http-equiv="refresh" content="\d+;url=\'foo\.bar\'" />#', preg_replace('/\s+/', ' ', $response->getContent()));
2724
}
2825

2926
public function testRedirectResponseConstructorNullUrl()

0 commit comments

Comments
 (0)
0