]> source.dussan.org Git - redmine.git/commitdiff
SCM AbstractAdapter use shell_quote to more properly escape path (closes #838 by...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 12 Mar 2008 23:00:11 +0000 (23:00 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 12 Mar 2008 23:00:11 +0000 (23:00 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1238 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/abstract_adapter.rb
lib/redmine/scm/adapters/subversion_adapter.rb

index 5db4964e9506ebefca50d5c2bd6bb8d60f8efdcf..41edf00add8362fafb639b6c066b23fc93f592b3 100644 (file)
@@ -101,9 +101,9 @@ module Redmine
         end
         
         def target(path)
-          path ||= ""
-          base = path.match(/^\//) ? root_url : url    
-          " \"" << "#{base}/#{path}".gsub(/["?<>\*]/, '') << "\""
+          path ||= ''
+          base = path.match(/^\//) ? root_url : url
+          shell_quote("#{base}/#{path}".gsub(/[?<>\*]/, ''))
         end
             
         def logger
index 5b6bfa97ce8e5ccd83e46f9e5be0fd229ffc5ec8..1e0320e2ca506a86f79713c8690d9d3821f6dd31 100644 (file)
@@ -100,7 +100,7 @@ module Redmine
           cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}"\r
           cmd << credentials_string\r
           cmd << " --verbose " if  options[:with_paths]\r
-          cmd << target(path)\r
+          cmd << ' ' + target(path)\r
           shellout(cmd) do |io|\r
             begin\r
               doc = REXML::Document.new(io)\r
@@ -139,7 +139,7 @@ module Redmine
           cmd = "#{SVN_BIN} diff -r "\r
           cmd << "#{identifier_to}:"\r
           cmd << "#{identifier_from}"\r
-          cmd << "#{target(path)}@#{identifier_from}"\r
+          cmd << " #{target(path)}@#{identifier_from}"\r
           cmd << credentials_string\r
           diff = []\r
           shellout(cmd) do |io|\r