Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
nicolas-grekas committed Nov 4, 2024
2 parents 836d34f + d94dda5 commit 0776b99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ private function escapeArgument(?string $argument): string
if (str_contains($argument, "\0")) {
$argument = str_replace("\0", '?', $argument);
}
if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) {
if (!preg_match('/[()%!^"<>&|\s]/', $argument)) {
return $argument;
}
$argument = preg_replace('/(\\\\+)$/', '$1$1', $argument);
Expand Down
7 changes: 6 additions & 1 deletion Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,12 @@ public function testGetCommandLine()
{
$p = new Process(['/usr/bin/php']);

$expected = '\\' === \DIRECTORY_SEPARATOR ? '"/usr/bin/php"' : "'/usr/bin/php'";
$expected = '\\' === \DIRECTORY_SEPARATOR ? '/usr/bin/php' : "'/usr/bin/php'";
$this->assertSame($expected, $p->getCommandLine());

$p = new Process(['cd', '/d']);

$expected = '\\' === \DIRECTORY_SEPARATOR ? 'cd /d' : "'cd' '/d'";
$this->assertSame($expected, $p->getCommandLine());
}

Expand Down

0 comments on commit 0776b99

Please sign in to comment.