Permalink
Browse files

Merge branch '3.4'

* 3.4:
  Add TokenProcessor
  [DI] Handle root namespace in service definitions
  Add support for command lazy-loading
  Use rawurlencode() to transform the Cookie into a string
  [TwigBundle] Added a RuntimeExtensionInterface to take advantage of autoconfigure
  [Process] Fix parsing args on Windows
  Add exculde verbosity test
  [HttpKernel][VarDumper] Truncate profiler data & optim perf
  [DI] Allow imports in string format for YAML
  [Validator] Allow to use a property path to get value to compare in comparison constraints
  [Security] Fix authentication.failure event not dispatched on AccountStatusException
  add option to define the access decision manager
  Add support for doctrin/dbal 2.6 types
  • Loading branch information...
2 parents e7ca75c + 2695aab commit 2750e6512a31bea2bcbd088a7e231cb4192e99da @nicolas-grekas nicolas-grekas committed Jul 12, 2017
Showing with 23 additions and 2 deletions.
  1. +5 −2 Process.php
  2. +18 −0 Tests/ProcessTest.php
View
@@ -1472,14 +1472,17 @@ private function prepareWindowsCommandLine($cmd, array &$envBackup, array &$env
$varCount = 0;
$varCache = array();
$cmd = preg_replace_callback(
- '/"(
+ '/"(?:(
[^"%!^]*+
(?:
(?: !LF! | "(?:\^[%!^])?+" )
[^"%!^]*+
)++
- )"/x',
+ ) | [^"]*+ )"/x',
function ($m) use (&$envBackup, &$env, &$varCache, &$varCount, $uid) {
+ if (!isset($m[1])) {
+ return $m[0];
+ }
if (isset($varCache[$m[0]])) {
return $varCache[$m[0]];
}
View
@@ -1423,6 +1423,24 @@ public function testEscapeArgument($arg)
$this->assertSame($arg, $p->getOutput());
}
+ public function testRawCommandLine()
+ {
+ $p = new Process(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')));
+ $p->run();
+
+ $expected = <<<EOTXT
+Array
+(
+ [0] => -
+ [1] => a
+ [2] =>
+ [3] => b
+)
+
+EOTXT;
+ $this->assertSame($expected, $p->getOutput());
+ }
+
public function provideEscapeArgument()
{
yield array('a"b%c%');

0 comments on commit 2750e65

Please sign in to comment.