瀏覽代碼

escape arguments

till 13 年之前
父節點
當前提交
adfac9e34b
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/Composer/Repository/Vcs/SvnDriver.php

+ 6 - 2
src/Composer/Repository/Vcs/SvnDriver.php

@@ -218,8 +218,12 @@ class SvnDriver extends VcsDriver implements VcsDriverInterface
         if ($this->useAuth !== true) {
             return '';
         }
-        $str = ' --no-auth-cache --username "%s" --password "%s" ';
-        return sprintf($str, $this->svnUsername, $this->svnPassword);
+        $str = ' --no-auth-cache --username %s --password %s ';
+        return sprintf(
+            $str,
+            escapeshellarg($this->svnUsername),
+            escapeshellarg($this->svnPassword)
+        );
     }
 
     /**