From ae1081df80a883d228d07f00bbc654d053eabaee Mon Sep 17 00:00:00 2001 From: haneul Date: Fri, 26 Dec 2008 09:05:44 +0000 Subject: [PATCH] #17579744 : if blank is included in svn_cmd quote svn_cmd with double quotation mark, and unquote for arguments git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5192 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/issuetracker/classes/svn.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/issuetracker/classes/svn.class.php b/modules/issuetracker/classes/svn.class.php index 2f1edcd40..97a35c977 100644 --- a/modules/issuetracker/classes/svn.class.php +++ b/modules/issuetracker/classes/svn.class.php @@ -19,7 +19,8 @@ if(substr($url,-1)!='/') $url .= '/'; $this->url = $url; - $this->svn_cmd = $svn_cmd; + if(strstr($svn_cmd, " ") != FALSE) $this->svn_cmd = '"'.$svn_cmd.'"' ; + else $this->svn_cmd = $svn_cmd; $this->diff_cmd = $diff_cmd; $this->tmp_dir = _XE_PATH_.'files/cache/tmp'; @@ -32,7 +33,7 @@ if(substr($path,0,1)=='/') $path = substr($path,1); if(strpos($path,'..')!==false) return; - $command = sprintf("%s --non-interactive --config-dir %s log --xml --limit 1 \"%s%s\"", $this->svn_cmd, $this->tmp_dir, $this->url, $path); + $command = sprintf("%s --non-interactive --config-dir %s log --xml --limit 1 %s%s", $this->svn_cmd, $this->tmp_dir, $this->url, $path); $buff = $this->execCmd($command, $error); $xmlDoc = $this->oXml->parse($buff); @@ -52,7 +53,7 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive --config-dir %s list "%s%s"%s', + '%s --non-interactive --config-dir %s list %s%s%s', $this->svn_cmd, $this->tmp_dir, $this->url, @@ -94,7 +95,7 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive --config-dir %s cat "%s%s"%s', + '%s --non-interactive --config-dir %s cat %s%s%s', $this->svn_cmd, $this->tmp_dir, $this->url, @@ -178,14 +179,14 @@ function getComp($path, $brev, $erev) { if(!$brev) { - $command = sprintf('%s --non-interactive --config-dir %s log --xml --limit 2 "%s%s@%d"', $this->svn_cmd, $this->tmp_dir, $this->url, $path, $erev); + $command = sprintf('%s --non-interactive --config-dir %s log --xml --limit 2 %s%s@%d', $this->svn_cmd, $this->tmp_dir, $this->url, $path, $erev); $buff = $this->execCmd($command, $error); $xmlDoc = $this->oXml->parse($buff); $brev = $xmlDoc->log->logentry[1]->attrs->revision; if(!$brev) return; } - $command = sprintf('%s --non-interactive --config-dir %s diff "%s%s@%d" "%s%s@%d"', + $command = sprintf('%s --non-interactive --config-dir %s diff %s%s@%d %s%s@%d', $this->svn_cmd, $this->tmp_dir, $this->url, @@ -249,7 +250,7 @@ if(strpos($path,'..')!==false) return; $command = sprintf( - '%s --non-interactive --config-dir %s log --xml %s %s %s "%s%s"', + '%s --non-interactive --config-dir %s log --xml %s %s %s %s%s', $this->svn_cmd, $this->tmp_dir, $quiet?'--quiet':'--verbose',