Skip to content

Commit 8ab7310

Browse files
committed
honor cmd quotes on Windows in run-tests.php
1 parent 8dae878 commit 8ab7310

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

run-tests.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,13 @@ function system_with_timeout(
12601260
) {
12611261
global $valgrind;
12621262

1263+
// when proc_open cmd is passed as a string (without bypass_shell=true option) the cmd goes thru shell
1264+
// and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing
1265+
// spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly
1266+
if (IS_WINDOWS) {
1267+
$commandline = 'start "" /b /wait ' . $commandline;
1268+
}
1269+
12631270
$data = '';
12641271

12651272
$bin_env = [];

0 commit comments

Comments
 (0)