diff --git a/Zend/tests/bug40236.phpt b/Zend/tests/bug40236.phpt index 35ed84066b8b0..7ed298c1eed66 100644 --- a/Zend/tests/bug40236.phpt +++ b/Zend/tests/bug40236.phpt @@ -6,8 +6,8 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline"); ?> --FILE-- --EXPECT-- diff --git a/Zend/tests/bug60978.phpt b/Zend/tests/bug60978.phpt index 5dc6fe31e7166..2d83d2a213e61 100644 --- a/Zend/tests/bug60978.phpt +++ b/Zend/tests/bug60978.phpt @@ -2,8 +2,7 @@ Bug #60978 (exit code incorrect) --FILE-- --EXPECT-- diff --git a/ext/com_dotnet/tests/bug77578.phpt b/ext/com_dotnet/tests/bug77578.phpt index 653a16123218d..a820935d5d775 100644 --- a/ext/com_dotnet/tests/bug77578.phpt +++ b/ext/com_dotnet/tests/bug77578.phpt @@ -6,8 +6,8 @@ com_dotnet --INI-- sendmail_path={MAIL:{PWD}/gh7902.eml} diff --git a/ext/simplexml/tests/bug79971_1.phpt b/ext/simplexml/tests/bug79971_1.phpt index 1097d74bb29d2..2ee07c81822ff 100644 --- a/ext/simplexml/tests/bug79971_1.phpt +++ b/ext/simplexml/tests/bug79971_1.phpt @@ -1,8 +1,10 @@ --TEST-- Bug #79971 (special character is breaking the path in xml function) +--EXTENSIONS-- +simplexml --SKIPIF-- --FILE-- --EXPECTF-- diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index 55078568152c4..49ac237f1ab6e 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -6,22 +6,21 @@ output_handler= '.$tmpfile ; + $cmd = $php_escaped . $args . ' -r ' . escapeshellarg('passthru("'.$cmd.'");') . ' > '.escapeshellarg($tmpfile); } else { - $cmd = $php . $args . ' -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"'; - $cmd = $php . $args . ' -r " passthru(\''.$cmd.'\');" > '.$tmpfile ; + $cmd = $php_escaped . $args . ' -r ' . "\"passthru('".addslashes($cmd)."');\"" . ' > '.escapeshellarg($tmpfile); } exec($cmd); diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt index 8a5df91ec1834..2e652fa34390a 100644 --- a/ext/standard/tests/file/bug26615.phpt +++ b/ext/standard/tests/file/bug26615.phpt @@ -7,9 +7,9 @@ variables_order=E $out = array(); $status = -1; if (substr(PHP_OS, 0, 3) != 'WIN') { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE_ESCAPED'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); } else { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE_ESCAPED'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); } print_r($out); ?> diff --git a/ext/standard/tests/file/bug26938.phpt b/ext/standard/tests/file/bug26938.phpt index 13732c03f6303..eec537d2d970b 100644 --- a/ext/standard/tests/file/bug26938.phpt +++ b/ext/standard/tests/file/bug26938.phpt @@ -4,7 +4,7 @@ Bug #26938 (exec does not read consecutive long lines correctly) '); $ds = array( @@ -19,7 +20,7 @@ $ds = array( ); $p = proc_open( - "$php -n $f テストマルチバイト・パス füße карамба", + "$php -n $f_escaped テストマルチバイト・パス füße карамба", $ds, $pipes, NULL, diff --git a/ext/standard/tests/general_functions/proc_open-mb1.phpt b/ext/standard/tests/general_functions/proc_open-mb1.phpt index 8a735cf306ed6..057979e604c76 100644 --- a/ext/standard/tests/general_functions/proc_open-mb1.phpt +++ b/ext/standard/tests/general_functions/proc_open-mb1.phpt @@ -7,9 +7,10 @@ if (!function_exists("proc_open")) echo "skip proc_open() is not available"; --FILE-- '); $ds = array( @@ -19,7 +20,7 @@ $ds = array( ); $p = proc_open( - "$php -n $f テストマルチバイト・パス füße карамба", + "$php -n $f_escaped テストマルチバイト・パス füße карамба", $ds, $pipes ); diff --git a/ext/standard/tests/general_functions/proc_open_pipes1.phpt b/ext/standard/tests/general_functions/proc_open_pipes1.phpt index 076b8c941e2c8..9822607c6f7ef 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes1.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes1.phpt @@ -7,8 +7,8 @@ for ($i = 3; $i<= 30; $i++) { $spec[$i] = array('pipe', 'w'); } -$php = getenv("TEST_PHP_EXECUTABLE"); -$callee = __DIR__ . "/proc_open_pipes_sleep.inc"; +$php = getenv("TEST_PHP_EXECUTABLE_ESCAPED"); +$callee = escapeshellarg(__DIR__ . "/proc_open_pipes_sleep.inc"); proc_open("$php -n $callee", $spec, $pipes); var_dump(count($spec)); diff --git a/ext/standard/tests/general_functions/proc_open_pipes2.phpt b/ext/standard/tests/general_functions/proc_open_pipes2.phpt index 3c1cf9695592f..c147a2f376464 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes2.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes2.phpt @@ -5,8 +5,8 @@ proc_open() with no pipes $spec = array(); -$php = getenv("TEST_PHP_EXECUTABLE"); -$callee = __DIR__ . "/proc_open_pipes_sleep.inc"; +$php = getenv("TEST_PHP_EXECUTABLE_ESCAPED"); +$callee = escapeshellarg(__DIR__ . "/proc_open_pipes_sleep.inc"); proc_open("$php -n $callee", $spec, $pipes); var_dump(count($spec)); diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index f5801ad63e435..1ee42904a0588 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -7,25 +7,26 @@ for ($i = 3; $i<= 5; $i++) { $spec[$i] = array('pipe', 'w'); } -$php = getenv("TEST_PHP_EXECUTABLE"); +$php = getenv("TEST_PHP_EXECUTABLE_ESCAPED"); $callee = __DIR__ . "/proc_open_pipes_sleep.inc"; +$callee_escaped = escapeshellarg($callee); $spec[$i] = array('pi'); -proc_open("$php -n $callee", $spec, $pipes); +proc_open("$php -n $callee_escaped", $spec, $pipes); $spec[$i] = 1; try { - proc_open("$php -n $callee", $spec, $pipes); + proc_open("$php -n $callee_escaped", $spec, $pipes); } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } $spec[$i] = array('pipe', "test"); -proc_open("$php -n $callee", $spec, $pipes); +proc_open("$php -n $callee_escaped", $spec, $pipes); var_dump($pipes); $spec[$i] = array('file', "test", "z"); -proc_open("$php -n $callee", $spec, $pipes); +proc_open("$php -n $callee_escaped", $spec, $pipes); var_dump($pipes); echo "END\n"; diff --git a/ext/standard/tests/ini_info/php_ini_loaded_file.phpt b/ext/standard/tests/ini_info/php_ini_loaded_file.phpt index b4ad617f9fec3..1fce24e67fe4d 100644 --- a/ext/standard/tests/ini_info/php_ini_loaded_file.phpt +++ b/ext/standard/tests/ini_info/php_ini_loaded_file.phpt @@ -3,14 +3,14 @@ php_ini_loaded_file() function --FILE-- --EXPECTREGEX-- bool\(false\) diff --git a/ext/standard/tests/ini_info/php_ini_scanned_files.phpt b/ext/standard/tests/ini_info/php_ini_scanned_files.phpt index 27d2bebadf12a..6f750584fd71c 100644 --- a/ext/standard/tests/ini_info/php_ini_scanned_files.phpt +++ b/ext/standard/tests/ini_info/php_ini_scanned_files.phpt @@ -3,7 +3,7 @@ php_ini_scanned_files() function --FILE-- --EXPECT-- diff --git a/ext/standard/tests/streams/bug46024.phpt b/ext/standard/tests/streams/bug46024.phpt index 5a712dcb6b92d..79078890ce1a1 100644 --- a/ext/standard/tests/streams/bug46024.phpt +++ b/ext/standard/tests/streams/bug46024.phpt @@ -2,17 +2,16 @@ Bug #46024 stream_select() doesn't return the correct number --SKIPIF-- --FILE-- array('pipe', 'r'), 1 => array('pipe', 'w')) ,$pipes, __DIR__, array(), array() ); diff --git a/ext/standard/tests/streams/bug70198.phpt b/ext/standard/tests/streams/bug70198.phpt index fc9c30f6fe348..0e122b66e8e7d 100644 --- a/ext/standard/tests/streams/bug70198.phpt +++ b/ext/standard/tests/streams/bug70198.phpt @@ -17,6 +17,7 @@ server $srv_addr = "tcp://127.0.0.1:8964"; $srv_fl = __DIR__ . "/bug70198_svr_" . md5(uniqid()) . ".php"; +$srv_fl_escaped = escapeshellarg($srv_fl); $srv_fl_cont = << array("file", "stderr.txt", "ab") ); $pipes = []; -$cmd = 'cmd.exe "/c START ^"^" /WAIT ' . PHP_BINARY . ' -r ^"var_dump(fgets(STDIN));"'; +$cmd = 'cmd.exe "/c START ^"^" /WAIT ' . getenv('TEST_PHP_EXECUTABLE_ESCAPED') . ' -r ^"var_dump(fgets(STDIN));"'; $proc = proc_open($cmd, $descriptorspec, $pipes); var_dump(is_resource($proc)); $pid = proc_get_status($proc)['pid']; diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt index 1c889f6e9877c..ba68fa2a208ff 100644 --- a/ext/standard/tests/streams/proc_open_bug51800_right.phpt +++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt @@ -9,8 +9,8 @@ if (strpos(PHP_OS, 'FreeBSD') !== false) { --FILE-- array("pipe", "r"),1 => array("pipe", "w")); $pipes = array(); -$process = proc_open(PHP_BINARY.' -n -f ' . $fl, $descriptorspec, $pipes, NULL, NULL, array("blocking_pipes" => true)); +$process = proc_open(getenv('TEST_PHP_EXECUTABLE_ESCAPED').' -n -f ' . escapeshellarg($fl), $descriptorspec, $pipes, NULL, NULL, array("blocking_pipes" => true)); $moreThanLimit = 0; for($i = 0; $i < 10; $i++){ diff --git a/run-tests.php b/run-tests.php index 9b892327c8dba..6ff9041a5d08b 100755 --- a/run-tests.php +++ b/run-tests.php @@ -678,10 +678,16 @@ function main(): void putenv("TEST_PHP_EXECUTABLE=$php"); $environment['TEST_PHP_EXECUTABLE'] = $php; + putenv("TEST_PHP_EXECUTABLE_ESCAPED=" . escapeshellarg($php)); + $environment['TEST_PHP_EXECUTABLE_ESCAPED'] = escapeshellarg($php); putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi"); $environment['TEST_PHP_CGI_EXECUTABLE'] = $php_cgi; + putenv("TEST_PHP_CGI_EXECUTABLE_ESCAPED=" . escapeshellarg($php_cgi)); + $environment['TEST_PHP_CGI_EXECUTABLE_ESCAPED'] = escapeshellarg($php_cgi); putenv("TEST_PHPDBG_EXECUTABLE=$phpdbg"); $environment['TEST_PHPDBG_EXECUTABLE'] = $phpdbg; + putenv("TEST_PHPDBG_EXECUTABLE_ESCAPED=" . escapeshellarg($phpdbg)); + $environment['TEST_PHPDBG_EXECUTABLE_ESCAPED'] = escapeshellarg($phpdbg); if ($conf_passed !== null) { if (IS_WINDOWS) { @@ -831,6 +837,7 @@ function verify_config(): void function write_information(): void { global $php, $php_cgi, $phpdbg, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test, $valgrind, $no_file_cache; + $php_escaped = escapeshellarg($php); // Get info from php $info_file = __DIR__ . '/run-test-info.php'; @@ -846,11 +853,12 @@ function write_information(): void $info_params = []; settings2array($ini_overwrites, $info_params); $info_params = settings2params($info_params); - $php_info = shell_exec("$php $pass_options $info_params $no_file_cache \"$info_file\""); - define('TESTED_PHP_VERSION', shell_exec("$php -n -r \"echo PHP_VERSION;\"")); + $php_info = shell_exec("$php_escaped $pass_options $info_params $no_file_cache \"$info_file\""); + define('TESTED_PHP_VERSION', shell_exec("$php_escaped -n -r \"echo PHP_VERSION;\"")); if ($php_cgi && $php != $php_cgi) { - $php_info_cgi = shell_exec("$php_cgi $pass_options $info_params $no_file_cache -q \"$info_file\""); + $php_cgi_escaped = escapeshellarg($php_cgi); + $php_info_cgi = shell_exec("$php_cgi_escaped $pass_options $info_params $no_file_cache -q \"$info_file\""); $php_info_sep = "\n---------------------------------------------------------------------"; $php_cgi_info = "$php_info_sep\nPHP : $php_cgi $php_info_cgi$php_info_sep"; } else { @@ -858,7 +866,8 @@ function write_information(): void } if ($phpdbg) { - $phpdbg_info = shell_exec("$phpdbg $pass_options $info_params $no_file_cache -qrr \"$info_file\""); + $phpdbg_escaped = escapeshellarg($phpdbg); + $phpdbg_info = shell_exec("$phpdbg_escaped $pass_options $info_params $no_file_cache -qrr \"$info_file\""); $php_info_sep = "\n---------------------------------------------------------------------"; $phpdbg_info = "$php_info_sep\nPHP : $phpdbg $phpdbg_info$php_info_sep"; } else { @@ -884,7 +893,7 @@ function write_information(): void } echo implode(',', $exts); PHP); - $extensionsNames = explode(',', shell_exec("$php $pass_options $info_params $no_file_cache \"$info_file\"")); + $extensionsNames = explode(',', shell_exec("$php_escaped $pass_options $info_params $no_file_cache \"$info_file\"")); $exts_to_test = array_unique(remap_loaded_extensions_names($extensionsNames)); // check for extensions that need special handling and regenerate $info_params_ex = [ @@ -1163,6 +1172,13 @@ function system_with_timeout( ) { global $valgrind; + // when proc_open cmd is passed as a string (without bypass_shell=true option) the cmd goes thru shell + // and on Windows quotes are discarded, this is a fix to honor the quotes and allow values containing + // spaces like '"C:\Program Files\PHP\php.exe"' to be passed as 1 argument correctly + if (IS_WINDOWS) { + $commandline = 'start "" /b /wait ' . $commandline; + } + $data = ''; $bin_env = []; @@ -1838,6 +1854,7 @@ function run_test(string $php, $file, array $env): string $org_file = $file; $orig_php = $php; + $php = escapeshellarg($php); $php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'] ?? null; $phpdbg = $env['TEST_PHPDBG_EXECUTABLE'] ?? null; @@ -1898,7 +1915,7 @@ function run_test(string $php, $file, array $env): string if (!$php_cgi) { return skip_test($tested, $tested_file, $shortname, 'CGI not available'); } - $php = $php_cgi . ' -C '; + $php = escapeshellarg($php_cgi) . ' -C '; $uses_cgi = true; if ($num_repeats > 1) { return skip_test($tested, $tested_file, $shortname, 'CGI does not support --repeat'); @@ -1909,7 +1926,7 @@ function run_test(string $php, $file, array $env): string $extra_options = ''; if ($test->hasSection('PHPDBG')) { if (isset($phpdbg)) { - $php = $phpdbg . ' -qIb'; + $php = escapeshellarg($phpdbg) . ' -qIb'; // Additional phpdbg command line options for sections that need to // be run straight away. For example, EXTENSIONS, SKIPIF, CLEAN. diff --git a/sapi/cgi/tests/bug75574_utf8.phpt b/sapi/cgi/tests/bug75574_utf8.phpt index 9cbd51abfbd99..76d2d8c1f4cda 100644 --- a/sapi/cgi/tests/bug75574_utf8.phpt +++ b/sapi/cgi/tests/bug75574_utf8.phpt @@ -13,7 +13,7 @@ include "skipif.inc"; include "include.inc"; -$php = get_cgi_path(); +$php = escapeshellarg(get_cgi_path()); reset_env_vars(); $fn = __DIR__ . DIRECTORY_SEPARATOR . md5(uniqid()); diff --git a/sapi/cgi/tests/include.inc b/sapi/cgi/tests/include.inc index de526723df0f5..d155edf4ba208 100644 --- a/sapi/cgi/tests/include.inc +++ b/sapi/cgi/tests/include.inc @@ -3,12 +3,13 @@ function get_cgi_path() /* {{{ */ { $php = getenv("TEST_PHP_EXECUTABLE"); + $php_escaped = getenv("TEST_PHP_EXECUTABLE_ESCAPED"); $cli = false; $cgi = false; if (file_exists($php) && is_executable($php)) { - $version = `$php -n -v`; + $version = `$php_escaped -n -v`; if (strstr($version, "(cli)")) { /* that's cli */ $cli = true; diff --git a/sapi/cli/tests/001.phpt b/sapi/cli/tests/001.phpt index ede63ffb033ec..aced33623eff4 100644 --- a/sapi/cli/tests/001.phpt +++ b/sapi/cli/tests/001.phpt @@ -5,7 +5,7 @@ version string --FILE-- --EXPECT-- diff --git a/sapi/cli/tests/003.phpt b/sapi/cli/tests/003.phpt index 63e812d4a7cd7..20bf61a247bf9 100644 --- a/sapi/cli/tests/003.phpt +++ b/sapi/cli/tests/003.phpt @@ -10,7 +10,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- diff --git a/sapi/cli/tests/006.phpt b/sapi/cli/tests/006.phpt index 1f2af9c6b6358..9d693f65969b4 100644 --- a/sapi/cli/tests/006.phpt +++ b/sapi/cli/tests/006.phpt @@ -15,7 +15,7 @@ date.timezone=UTC --FILE-- --CLEAN-- diff --git a/sapi/cli/tests/011.phpt b/sapi/cli/tests/011.phpt index 24eb9fc2dfff4..bd61b260f5a94 100644 --- a/sapi/cli/tests/011.phpt +++ b/sapi/cli/tests/011.phpt @@ -5,9 +5,10 @@ syntax check --FILE-- diff --git a/sapi/cli/tests/012.phpt b/sapi/cli/tests/012.phpt index 08ec4ecb1c736..be21b3d99e87c 100644 --- a/sapi/cli/tests/012.phpt +++ b/sapi/cli/tests/012.phpt @@ -5,16 +5,16 @@ invalid arguments and error messages --FILE-- diff --git a/sapi/cli/tests/013.phpt b/sapi/cli/tests/013.phpt index 0684b8d0573cf..345a489403acc 100644 --- a/sapi/cli/tests/013.phpt +++ b/sapi/cli/tests/013.phpt @@ -10,14 +10,15 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- &1 | grep Usage:`; +echo `$php -n --version | grep built:`; +echo `echo "&1 | grep Usage:`; echo "Done\n"; ?> diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt index c7ce07913f15b..544633f592f6d 100644 --- a/sapi/cli/tests/016.phpt +++ b/sapi/cli/tests/016.phpt @@ -11,7 +11,7 @@ if (readline_info('done') === NULL) { ?> --FILE-- $code) { echo "\n--------------\nSnippet no. $key:\n--------------\n"; $code = escapeshellarg($code); - echo `echo $code | "$php" -a`, "\n"; + echo `echo $code | $php -a`, "\n"; } echo "\nDone\n"; diff --git a/sapi/cli/tests/017.phpt b/sapi/cli/tests/017.phpt index d2d37b18589a0..6adbf195e2ee6 100644 --- a/sapi/cli/tests/017.phpt +++ b/sapi/cli/tests/017.phpt @@ -11,7 +11,7 @@ if (readline_info('done') !== NULL) { ?> --FILE-- diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index e8404d835e5e7..0f5a66c871ef2 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -10,10 +10,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- diff --git a/sapi/cli/tests/020.phpt b/sapi/cli/tests/020.phpt index fb7bcb4e7b5f6..3ccd6a83d3b37 100644 --- a/sapi/cli/tests/020.phpt +++ b/sapi/cli/tests/020.phpt @@ -10,11 +10,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- diff --git a/sapi/cli/tests/021.phpt b/sapi/cli/tests/021.phpt index 837f64109d03d..9a24ec454a989 100644 --- a/sapi/cli/tests/021.phpt +++ b/sapi/cli/tests/021.phpt @@ -7,6 +7,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die ("skip not for Windows"); } +if (str_contains(getenv('TEST_PHP_EXECUTABLE'), " ")) { + die("skip shebang cannot have spaces in its path"); +} + if (strlen("#!".getenv('TEST_PHP_EXECUTABLE')) > 127) { die ("skip shebang is too long, see http://www.in-ulm.de/~mascheck/various/shebang/#results"); } diff --git a/sapi/cli/tests/022.phpt b/sapi/cli/tests/022.phpt index 40c2265351842..1afb5fc371a7a 100644 --- a/sapi/cli/tests/022.phpt +++ b/sapi/cli/tests/022.phpt @@ -7,7 +7,7 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test"); ?> --FILE-- --FILE-- array("pipe", "w"), ); $pipes = array(); -$proc = proc_open("$php -c $ini_file -r 'echo ini_get(\"memory_limit\");'", $desc, $pipes); +$proc = proc_open("$php -c $ini_file_escaped -r 'echo ini_get(\"memory_limit\");'", $desc, $pipes); if (!$proc) { exit(1); } diff --git a/sapi/cli/tests/argv_mb.phpt b/sapi/cli/tests/argv_mb.phpt index 5ed5cef34378b..f7f6dd49081b0 100644 --- a/sapi/cli/tests/argv_mb.phpt +++ b/sapi/cli/tests/argv_mb.phpt @@ -7,12 +7,13 @@ include "skipif.inc"; --FILE-- "); -var_dump(`$php -n $argv_fl 多字节字符串 マルチバイト文字列 многобайтоваястрока flerbytesträng`); +var_dump(`$php -n $argv_fl_escaped 多字节字符串 マルチバイト文字列 многобайтоваястрока flerbytesträng`); @unlink($argv_fl); diff --git a/sapi/cli/tests/bug61546.phpt b/sapi/cli/tests/bug61546.phpt index 071edb7224425..67b531472174a 100644 --- a/sapi/cli/tests/bug61546.phpt +++ b/sapi/cli/tests/bug61546.phpt @@ -11,7 +11,7 @@ Bug #61546 (functions related to current script failed when chdir() in cli sapi) // the ext/standard/tests/file/statpage.phpt test also tests getmyinode() returns an integer and will // pass even if that integer is 0. on Windows, the getmyinode() call in statpage.phpt returns 0 and // passes on Windows. -$php = getenv("TEST_PHP_EXECUTABLE"); +$php = getenv("TEST_PHP_EXECUTABLE_ESCAPED"); $test_code = << diff --git a/sapi/cli/tests/bug64529.phpt b/sapi/cli/tests/bug64529.phpt index dd7b809cfbc58..44df61020e474 100644 --- a/sapi/cli/tests/bug64529.phpt +++ b/sapi/cli/tests/bug64529.phpt @@ -18,7 +18,7 @@ if ($ret) { --FILE-- diff --git a/sapi/cli/tests/bug71624.phpt b/sapi/cli/tests/bug71624.phpt index 8b82ebab58c94..83f48cf921c5a 100644 --- a/sapi/cli/tests/bug71624.phpt +++ b/sapi/cli/tests/bug71624.phpt @@ -7,9 +7,10 @@ include "skipif.inc"; --FILE-- --FILE-- array("pipe", "w"), ); $pipes = array(); -$proc = proc_open("$php -c $ini_file -r 'echo \"okey\";'", $desc, $pipes); +$proc = proc_open("$php -c $ini_file_escaped -r 'echo \"okey\";'", $desc, $pipes); if (!$proc) { exit(1); } diff --git a/sapi/cli/tests/bug78323.phpt b/sapi/cli/tests/bug78323.phpt index 02b18e02a2141..d353281a0e866 100644 --- a/sapi/cli/tests/bug78323.phpt +++ b/sapi/cli/tests/bug78323.phpt @@ -6,7 +6,7 @@ include "skipif.inc"; ?> --FILE-- ["pipe", "r"], 1 => ["pipe", "w"]]; $proc = proc_open($cmd, $spec, $pipes, NULL, NULL, ["bypass_shell" => true, "create_process_group" => true]); diff --git a/sapi/phpdbg/tests/bug73615.phpt b/sapi/phpdbg/tests/bug73615.phpt index e5fccef0a85c3..2208cdebf707b 100644 --- a/sapi/phpdbg/tests/bug73615.phpt +++ b/sapi/phpdbg/tests/bug73615.phpt @@ -7,7 +7,7 @@ if (!getenv('TEST_PHPDBG_EXECUTABLE')) die("SKIP: No TEST_PHPDBG_EXECUTABLE spec --FILE-- &1"; + $cmd = getenv('TEST_PHP_EXECUTABLE_ESCAPED') . " -n -d html_errors=on -d extension_dir=a/�/w -d extension=php_kartoffelbrei.dll -v 2>&1"; $out = shell_exec($cmd); var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out)); diff --git a/tests/run-test/extensions-shared.phpt b/tests/run-test/extensions-shared.phpt index e8d9b52aa98a9..2bbe8b767655b 100644 --- a/tests/run-test/extensions-shared.phpt +++ b/tests/run-test/extensions-shared.phpt @@ -4,7 +4,7 @@ phpt EXTENSIONS directive - shared module openssl --SKIPIF--