From 66804f664ed6c843fbadaae49b6b7262ced006e9 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 27 Jul 2008 23:13:18 -0600 Subject: [PATCH] Add argument escaping. Signed-off-by: Edward Z. Yang --- library/Git.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Git.php b/library/Git.php index ac91fa5..2d8e522 100644 --- a/library/Git.php +++ b/library/Git.php @@ -67,7 +67,10 @@ class Git * if true. */ public function execute($command, $istream = null, $options = array()) { - if (is_array($command)) $command = implode(' ', $command); + if (is_array($command)) { + foreach ($command as &$c) $c = escapeshellarg($c); + $command = implode(' ', $command); + } //var_dump($command); $options = array_merge(array( 'withKeepCwd' => false, -- 2.11.4.GIT