1--TEST--
2GHSA-3qgc-jrrr-25jv
3--SKIPIF--
4<?php
5include 'skipif.inc';
6if (PHP_OS_FAMILY !== "Windows") die("skip Only for Windows");
7
8$codepage = trim(shell_exec("powershell Get-ItemPropertyValue HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage ACP"));
9if ($codepage !== '932' && $codepage !== '936' && $codepage !== '950') die("skip Wrong codepage");
10?>
11--FILE--
12<?php
13include 'include.inc';
14
15$filename = __DIR__."/GHSA-3qgc-jrrr-25jv_tmp.php";
16$script = '<?php echo "hello "; echo "world"; ?>';
17file_put_contents($filename, $script);
18
19$php = get_cgi_path();
20reset_env_vars();
21
22putenv("SERVER_NAME=Test");
23putenv("SCRIPT_FILENAME=$filename");
24putenv("QUERY_STRING=%ads");
25putenv("REDIRECT_STATUS=1");
26
27passthru("$php -s");
28
29?>
30--CLEAN--
31<?php
32@unlink(__DIR__."/GHSA-3qgc-jrrr-25jv_tmp.php");
33?>
34--EXPECTF--
35X-Powered-By: PHP/%s
36Content-type: %s
37
38hello world
39