Skip to content

Commit

Permalink
[HttpFoundation] Allow redirecting to URLs that contain a semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBizzle authored and nicolas-grekas committed Nov 17, 2019
1 parent eaca085 commit bd0637e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/RedirectResponse.php
Expand Up @@ -93,7 +93,7 @@ public function setTargetUrl($url)
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url=%1$s" />
<meta http-equiv="refresh" content="0;url=\'%1$s\'" />
<title>Redirecting to %1$s</title>
</head>
Expand Down
Expand Up @@ -20,10 +20,7 @@ public function testGenerateMetaRedirect()
{
$response = new RedirectResponse('foo.bar');

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

public function testRedirectResponseConstructorNullUrl()
Expand Down

0 comments on commit bd0637e

Please sign in to comment.