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

Skip to content

Commit 10c73d3

Browse files
bug #49580 [HttpClient] Fix encoding "+" in URLs (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix encoding "+" in URLs | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #49579 | License | MIT | Doc PR | - My bad. Commits ------- e79eebb [HttpClient] Fix encoding "+" in URLs
2 parents e8b2fb7 + e79eebb commit 10c73d3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ private static function mergeQueryString(?string $queryString, array $queryArray
629629
'%28' => '(',
630630
'%29' => ')',
631631
'%2A' => '*',
632-
'%2B' => '+',
633632
'%2C' => ',',
634633
'%2F' => '/',
635634
'%3A' => ':',

src/Symfony/Component/HttpClient/Tests/HttpClientTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ public static function provideParseUrl(): iterable
157157
yield [['http:', null, null, null, null], 'http:'];
158158
yield [['http:', null, 'bar', null, null], 'http:bar'];
159159
yield [[null, null, 'bar', '?a=1&c=c', null], 'bar?a=a&b=b', ['b' => null, 'c' => 'c', 'a' => 1]];
160-
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*+,;%3D:@%25\\^`{|}', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
161-
yield [[null, null, 'bar', '?a=b+%20c', null], 'bar?a=b+c', ['a' => 'b+ c']];
160+
yield [[null, null, 'bar', '?a=b+c&b=b-._~!$%26/%27()[]*%2B,;%3D:@%25\\^`{|}', null], 'bar?a=b+c', ['b' => 'b-._~!$&/\'()[]*+,;=:@%\\^`{|}']];
161+
yield [[null, null, 'bar', '?a=b%2B%20c', null], 'bar?a=b+c', ['a' => 'b+ c']];
162162
yield [[null, null, 'bar', '?a[b]=c', null], 'bar', ['a' => ['b' => 'c']]];
163163
yield [[null, null, 'bar', '?a[b[c]=d', null], 'bar?a[b[c]=d', []];
164164
yield [[null, null, 'bar', '?a[b][c]=dd', null], 'bar?a[b][c]=d&e[f]=g', ['a' => ['b' => ['c' => 'dd']], 'e[f]' => null]];

0 commit comments

Comments
 (0)