Skip to content

Commit

Permalink
Merge branch '3.4' into 4.3
Browse files Browse the repository at this point in the history
* 3.4:
  [HttpFoundation] Allow redirecting to URLs that contain a semicolon
  • Loading branch information
nicolas-grekas committed Nov 17, 2019
2 parents c8f4571 + ef5fed4 commit 0ac9ebf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RedirectResponse.php
Original file line number Diff line number Diff line change
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
5 changes: 1 addition & 4 deletions Tests/RedirectResponseTest.php
Original file line number Diff line number Diff line change
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 0ac9ebf

Please sign in to comment.