Split cmpShellEscArr and cmpShellEscStr
This commit is contained in:
16
cmpUtil.php
16
cmpUtil.php
@@ -250,8 +250,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cmpSysExec($cmaRaw, $opt = []) {
|
||||
function cmpShellEscArr($cmaRaw) {
|
||||
$ttr = array(
|
||||
"\t" => "\\\t", "\$" => "\\\$",
|
||||
"\\" => "\\\\", "\"" => "\\\"",
|
||||
@@ -277,7 +276,18 @@
|
||||
$cmaEsc[] = strtr($cmaRaw[$i], $ttr);
|
||||
}
|
||||
|
||||
$cmdStr = join(" ", $cmaEsc);
|
||||
return $cmaEsc;
|
||||
}
|
||||
|
||||
function cmpShellEscStr($cmaRaw) {
|
||||
$cmaEsc = $this->cmpShellEscArr($cmaRaw);
|
||||
|
||||
return join(" ", $cmaEsc);
|
||||
}
|
||||
|
||||
function cmpSysExec($cmaRaw, $opt = []) {
|
||||
$cmdStr = $this->cmpShellEscStr($cmaRaw);
|
||||
|
||||
if(!@$opt["silent"]) {
|
||||
$this->d("cmpSysExec: " . $cmdStr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user