summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-21 03:35:49 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-21 03:35:49 +0000
commita4b03289d52dd11f0f7eb1cb632d7bc067e54523 (patch)
tree4a6c4f9510a608972fd21cd1460f54c627f791ee /lib
parentdad8d7f2b37c562af507fd18eac74644658c1c52 (diff)
downloadredmine-a4b03289d52dd11f0f7eb1cb632d7bc067e54523.tar.gz
redmine-a4b03289d52dd11f0f7eb1cb632d7bc067e54523.zip
Merged r22205 from trunk to 5.0-stable (#38464).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22206 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/field_format.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index e6521656f..cc358ec03 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -273,15 +273,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%') {Addressable::URI.encode value.to_s}
- url.gsub!('%id%') {Addressable::URI.encode customized.id.to_s}
+ url.gsub!('%value%') {Addressable::URI.encode_component value.to_s}
+ url.gsub!('%id%') {Addressable::URI.encode_component customized.id.to_s}
url.gsub!('%project_id%') do
- Addressable::URI.encode(
+ Addressable::URI.encode_component(
(customized.respond_to?(:project) ? customized.project.try(:id) : nil).to_s
)
end
url.gsub!('%project_identifier%') do
- Addressable::URI.encode(
+ Addressable::URI.encode_component(
(customized.respond_to?(:project) ? customized.project.try(:identifier) : nil).to_s
)
end
@@ -289,7 +289,7 @@ module Redmine
url.gsub!(%r{%m(\d+)%}) do
m = $1.to_i
if matches ||= value.to_s.match(Regexp.new(custom_field.regexp))
- Addressable::URI.encode matches[m].to_s
+ Addressable::URI.encode_component matches[m].to_s
end
end
end