diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-12 23:00:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-12 23:00:11 +0000 |
commit | 2c1e63720ec972837b1bae3fde1acc3902ec23b0 (patch) | |
tree | cb733c17c1f89fad639869733a4b14299476cea5 /lib | |
parent | d4429a544c50c908d85259eb3706a6960b0a604d (diff) | |
download | redmine-2c1e63720ec972837b1bae3fde1acc3902ec23b0.tar.gz redmine-2c1e63720ec972837b1bae3fde1acc3902ec23b0.zip |
SCM AbstractAdapter use shell_quote to more properly escape path (closes #838 by John Goerzen).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1238 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/abstract_adapter.rb | 6 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/subversion_adapter.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index 5db4964e9..41edf00ad 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -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 diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb index 5b6bfa97c..1e0320e2c 100644 --- a/lib/redmine/scm/adapters/subversion_adapter.rb +++ b/lib/redmine/scm/adapters/subversion_adapter.rb @@ -100,7 +100,7 @@ module Redmine cmd = "#{SVN_BIN} log --xml -r #{identifier_from}:#{identifier_to}"
cmd << credentials_string
cmd << " --verbose " if options[:with_paths]
- cmd << target(path)
+ cmd << ' ' + target(path)
shellout(cmd) do |io|
begin
doc = REXML::Document.new(io)
@@ -139,7 +139,7 @@ module Redmine cmd = "#{SVN_BIN} diff -r "
cmd << "#{identifier_to}:"
cmd << "#{identifier_from}"
- cmd << "#{target(path)}@#{identifier_from}"
+ cmd << " #{target(path)}@#{identifier_from}"
cmd << credentials_string
diff = []
shellout(cmd) do |io|
|