Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dde0f3c

Browse filesBrowse files
committed
Merge branch '4.4' into 5.1
* 4.4: Run intl-data tests on resources change [FrameworkBundle] fix preserving some special chars in the query string when redirecting
2 parents 7652685 + a630685 commit dde0f3c
Copy full SHA for dde0f3c

File tree

Expand file treeCollapse file tree

3 files changed

+55
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+55
-5
lines changed

‎.github/workflows/intl-data-tests.yml

Copy file name to clipboard
+47Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Intl data tests
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/Symfony/Component/Intl/Resources/data/**'
7+
pull_request:
8+
paths:
9+
- 'src/Symfony/Component/Intl/Resources/data/**'
10+
11+
jobs:
12+
13+
tests:
14+
name: Tests (intl-data)
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Define the ICU version
22+
run: |
23+
SYMFONY_ICU_VERSION=$(php -r 'require "src/Symfony/Component/Intl/Intl.php"; echo Symfony\Component\Intl\Intl::getIcuStubVersion();')
24+
echo "SYMFONY_ICU_VERSION=$SYMFONY_ICU_VERSION" >> $GITHUB_ENV
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
coverage: "none"
30+
extensions: "zip,intl-${{env.SYMFONY_ICU_VERSION}}"
31+
ini-values: "memory_limit=-1"
32+
php-version: "7.4"
33+
34+
- name: Install dependencies
35+
run: |
36+
echo "::group::composer update"
37+
composer update --no-progress --no-suggest --ansi
38+
echo "::endgroup::"
39+
echo "::group::install phpunit"
40+
./phpunit install
41+
echo "::endgroup::"
42+
43+
- name: Report the ICU version
44+
run: icu-config --version && php -i | grep 'ICU version'
45+
46+
- name: Run intl-data tests
47+
run: ./phpunit --group intl-data -v

‎src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/RedirectController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private static function parseQuery(string $query)
212212
if (false === $i = strpos($k, '[')) {
213213
$q[] = bin2hex($k).$v;
214214
} else {
215-
$q[] = substr_replace($k, bin2hex(substr($k, 0, $i)), 0, $i).$v;
215+
$q[] = bin2hex(substr($k, 0, $i)).rawurlencode(substr($k, $i)).$v;
216216
}
217217
}
218218

‎src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,19 @@ public function testRedirectWithQuery()
302302
$baseUrl = '/base';
303303
$port = 80;
304304

305-
$request = $this->createRequestObject($scheme, $host, $port, $baseUrl, 'b.se=zaza');
305+
$request = $this->createRequestObject($scheme, $host, $port, $baseUrl, 'b.se=zaza&f[%2525][%26][%3D][p.c]=d');
306306
$request->attributes = new ParameterBag(['_route_params' => ['base2' => 'zaza']]);
307307
$urlGenerator = $this->getMockBuilder(UrlGeneratorInterface::class)->getMock();
308-
$urlGenerator->expects($this->exactly(2))->method('generate')->willReturn('/test?b.se=zaza&base2=zaza')->with('/test', ['b.se' => 'zaza', 'base2' => 'zaza'], UrlGeneratorInterface::ABSOLUTE_URL);
308+
$urlGenerator->expects($this->exactly(2))
309+
->method('generate')
310+
->willReturn('/test?b.se=zaza&base2=zaza&f[%2525][%26][%3D][p.c]=d')
311+
->with('/test', ['b.se' => 'zaza', 'base2' => 'zaza', 'f' => ['%25' => ['&' => ['=' => ['p.c' => 'd']]]]], UrlGeneratorInterface::ABSOLUTE_URL);
309312

310313
$controller = new RedirectController($urlGenerator);
311-
$this->assertRedirectUrl($controller->redirectAction($request, '/test', false, false, false, true), '/test?b.se=zaza&base2=zaza');
314+
$this->assertRedirectUrl($controller->redirectAction($request, '/test', false, false, false, true), '/test?b.se=zaza&base2=zaza&f[%2525][%26][%3D][p.c]=d');
312315

313316
$request->attributes->set('_route_params', ['base2' => 'zaza', 'route' => '/test', 'ignoreAttributes' => false, 'keepRequestMethod' => false, 'keepQueryParams' => true]);
314-
$this->assertRedirectUrl($controller($request), '/test?b.se=zaza&base2=zaza');
317+
$this->assertRedirectUrl($controller($request), '/test?b.se=zaza&base2=zaza&f[%2525][%26][%3D][p.c]=d');
315318
}
316319

317320
public function testRedirectWithQueryWithRouteParamsOveriding()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.