Skip to content

Commit cb22aff

Browse files
Merge branch '5.4' into 6.4
* 5.4: [Validator] Fix 58691 (missing plural-options in serbian language translation) profiler form data collector extart value property if it is setted [Process] Fix escaping /X arguments on Windows [Config] Handle Phar absolute path in `FileLocator`
2 parents c958f59 + e37bdf0 commit cb22aff

File tree

7 files changed

+125
-116
lines changed

7 files changed

+125
-116
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,10 @@
646646
<td>{{ profiler_dump(value) }}</td>
647647
<td>
648648
{# values can be stubs #}
649-
{% set option_value = value.value|default(value) %}
650-
{% set resolved_option_value = data.resolved_options[option].value|default(data.resolved_options[option]) %}
649+
{% set option_value = (value.value is defined) ? value.value : value %}
650+
{% set resolved_option_value = (data.resolved_options[option].value is defined)
651+
? data.resolved_options[option].value
652+
: data.resolved_options[option] %}
651653
{% if resolved_option_value == option_value %}
652654
<em class="font-normal text-muted">same as passed value</em>
653655
{% else %}

src/Symfony/Component/Config/FileLocator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private function isAbsolutePath(string $file): bool
8787
&& ('\\' === $file[2] || '/' === $file[2])
8888
)
8989
|| parse_url($file, \PHP_URL_SCHEME)
90+
|| str_starts_with($file, 'phar:///') // "parse_url()" doesn't handle absolute phar path, despite being valid
9091
) {
9192
return true;
9293
}

src/Symfony/Component/Config/Tests/FileLocatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function getIsAbsolutePathTests(): array
3838
['\\server\\foo.xml'],
3939
['https://server/foo.xml'],
4040
['phar://server/foo.xml'],
41+
['phar:///server/foo.xml'],
4142
];
4243
}
4344

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ private function escapeArgument(?string $argument): string
15821582
if (str_contains($argument, "\0")) {
15831583
$argument = str_replace("\0", '?', $argument);
15841584
}
1585-
if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) {
1585+
if (!preg_match('/[()%!^"<>&|\s]/', $argument)) {
15861586
return $argument;
15871587
}
15881588
$argument = preg_replace('/(\\\\+)$/', '$1$1', $argument);

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,12 @@ public function testGetCommandLine()
14361436
{
14371437
$p = new Process(['/usr/bin/php']);
14381438

1439-
$expected = '\\' === \DIRECTORY_SEPARATOR ? '"/usr/bin/php"' : "'/usr/bin/php'";
1439+
$expected = '\\' === \DIRECTORY_SEPARATOR ? '/usr/bin/php' : "'/usr/bin/php'";
1440+
$this->assertSame($expected, $p->getCommandLine());
1441+
1442+
$p = new Process(['cd', '/d']);
1443+
1444+
$expected = '\\' === \DIRECTORY_SEPARATOR ? 'cd /d' : "'cd' '/d'";
14401445
$this->assertSame($expected, $p->getCommandLine());
14411446
}
14421447

src/Symfony/Component/Validator/Resources/translations/validators.sr_Cyrl.xlf

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.

src/Symfony/Component/Validator/Resources/translations/validators.sr_Latn.xlf

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)