mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-06 01:31:14 -04:00
Escapes shell arguments. See issue #197.
This commit is contained in:
parent
4cf5b13d06
commit
1f9365ae97
2 changed files with 5 additions and 5 deletions
|
@ -44,9 +44,9 @@ class Archive {
|
|||
|
||||
private function shell_cmd($cmd) {
|
||||
|
||||
$cmd = str_replace("[ROOTDIR]", "\"" . $this->app->get_abs_path() . "\"", $cmd);
|
||||
$cmd = str_replace("[DIRS]", count($this->dirs) ? "\"" . implode("\" \"", array_values($this->dirs)) . "\"" : "", $cmd);
|
||||
$cmd = str_replace("[FILES]", count($this->files) ? "\"" . implode("\" \"", array_values($this->files)) . "\"" : "", $cmd);
|
||||
$cmd = str_replace("[ROOTDIR]", escapeshellarg($this->app->get_abs_path()), $cmd);
|
||||
$cmd = str_replace("[DIRS]", count($this->dirs) ? implode(" ", array_map("escapeshellarg", $this->dirs)) : "", $cmd);
|
||||
$cmd = str_replace("[FILES]", count($this->files) ? implode(" ", array_map("escapeshellarg", $this->files)) : "", $cmd);
|
||||
try {
|
||||
passthru($cmd);
|
||||
} catch (Exeption $err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue