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