diff options
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/field_format.rb | 10 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/subversion_adapter.rb | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index d063d1ccf..1df164e0a 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -269,15 +269,15 @@ module Redmine # %m1%, %m2%... => capture groups matches of the custom field regexp if defined def url_from_pattern(custom_field, value, customized) url = custom_field.url_pattern.to_s.dup - url.gsub!('%value%') {URI.encode value.to_s} - url.gsub!('%id%') {URI.encode customized.id.to_s} + url.gsub!('%value%') {Addressable::URI.encode value.to_s} + url.gsub!('%id%') {Addressable::URI.encode customized.id.to_s} url.gsub!('%project_id%') { - URI.encode( + Addressable::URI.encode( (customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s ) } url.gsub!('%project_identifier%') { - URI.encode( + Addressable::URI.encode( (customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s ) } @@ -285,7 +285,7 @@ module Redmine url.gsub!(%r{%m(\d+)%}) do m = $1.to_i if matches ||= value.to_s.match(Regexp.new(custom_field.regexp)) - URI.encode matches[m].to_s + Addressable::URI.encode matches[m].to_s end end end diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb index 09b4aacb5..8748641ce 100644 --- a/lib/redmine/scm/adapters/subversion_adapter.rb +++ b/lib/redmine/scm/adapters/subversion_adapter.rb @@ -108,7 +108,7 @@ module Redmine next if entry['kind'] == 'dir' && commit_date.nil? name = entry['name']['__content__'] - entries << Entry.new({:name => URI.unescape(name), + entries << Entry.new({:name => CGI.unescape(name), :path => ((path.empty? ? "" : "#{path}/") + name), :kind => entry['kind'], :size => ((s = entry['size']) ? s['__content__'].to_i : nil), @@ -289,7 +289,7 @@ module Redmine def target(path = '') base = /^\//.match?(path) ? root_url : url uri = "#{base}/#{path}" - uri = URI.escape(URI.escape(uri), '[]') + uri = Addressable::URI.encode(uri) shell_quote(uri.gsub(/[?<>\*]/, '')) end end |