Add argument escaping.master
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Mon, 28 Jul 2008 05:13:18 +0000 (27 23:13 -0600)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Mon, 28 Jul 2008 05:13:18 +0000 (27 23:13 -0600)
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
library/Git.php

index ac91fa5..2d8e522 100644 (file)
@@ -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,