/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
php-8.3.26
sapi/cli/tests/010.phpt
46 строк
757 B
Niels Dossche
Fix GH-10489: run-tests.php does not escape path when building cmd (#10560)
25 фев 2023, 17:02
Не верифицирован
25 фев 2023, 17:02
dcc3255
Код
Авторство
О чём код?
--TEST-- executing a file with -F --SKIPIF-- <?php include "skipif.inc"; if (substr(PHP_OS, 0, 3) == 'WIN') { die ("skip not for Windows"); } ?> --FILE-- <?php $php = getenv('TEST_PHP_EXECUTABLE_ESCAPED'); $filename = __DIR__."/010.test.php"; $filename_escaped = escapeshellarg($filename); $filename_txt = __DIR__."/010.test.txt"; $filename_txt_escaped = escapeshellarg($filename_txt); $code = ' <?php var_dump(fread(STDIN, 10)); ?> '; file_put_contents($filename, $code); $txt = ' test hello'; file_put_contents($filename_txt, $txt); var_dump(`cat $filename_txt_escaped | $php -n -F $filename_escaped`); ?> --CLEAN-- <?php @unlink(__DIR__."/010.test.php"); @unlink(__DIR__."/010.test.txt"); ?> --EXPECT-- string(25) " string(10) "test hello" "