Skip to content

Commit 33b7c72

Browse files
committed
feature #59022 [HttpFoundation] Generate url-safe hashes for signed urls (valtzu)
This PR was merged into the 7.3 branch. Discussion ---------- [HttpFoundation] Generate url-safe hashes for signed urls | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #52822 | License | MIT Generate url-safe signed urls since some clients can't handle parameter encoding correctly and are sending `%2B` as `+` which PHP reads as ` ` (space), making the signature invalid. Backwards-compatibility is included, and planned to be removed in 8.0 – which will mean all signed urls generated with <7.3 are rendered invalid. Commits ------- a5337500aa4 Generate url-safe signatures
2 parents 8a1c711 + 7bb5613 commit 33b7c72

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/Functional/FragmentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public function testGenerateFragmentUri()
5050
$client = self::createClient(['test_case' => 'Fragment', 'root_config' => 'config.yml', 'debug' => true]);
5151
$client->request('GET', '/fragment_uri');
5252

53-
$this->assertSame('/_fragment?_hash=CCRGN2D%2FoAJbeGz%2F%2FdoH3bNSPwLCrmwC1zAYCGIKJ0E%3D&_path=_format%3Dhtml%26_locale%3Den%26_controller%3DSymfony%255CBundle%255CFrameworkBundle%255CTests%255CFunctional%255CBundle%255CTestBundle%255CController%255CFragmentController%253A%253AindexAction', $client->getResponse()->getContent());
53+
$this->assertSame('/_fragment?_hash=CCRGN2D_oAJbeGz__doH3bNSPwLCrmwC1zAYCGIKJ0E&_path=_format%3Dhtml%26_locale%3Den%26_controller%3DSymfony%255CBundle%255CFrameworkBundle%255CTests%255CFunctional%255CBundle%255CTestBundle%255CController%255CFragmentController%253A%253AindexAction', $client->getResponse()->getContent());
5454
}
5555
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"symfony/deprecation-contracts": "^2.5|^3",
2626
"symfony/error-handler": "^6.4|^7.0",
2727
"symfony/event-dispatcher": "^6.4|^7.0",
28-
"symfony/http-foundation": "^6.4|^7.0",
28+
"symfony/http-foundation": "^7.3",
2929
"symfony/http-kernel": "^7.2",
3030
"symfony/polyfill-mbstring": "~1.0",
3131
"symfony/filesystem": "^7.1",

0 commit comments

Comments
 (0)