summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-09-18 08:06:48 +0000
committerGo MAEDA <maeda@farend.jp>2023-09-18 08:06:48 +0000
commitea4bf1eba4b680159a873aa468364826f4d13385 (patch)
tree56259c971b5f66bef0fb4b5b6040f77dd3b60a56 /lib
parent03bcf782463c9b84c6fe53b17cb1b781df6d8771 (diff)
downloadredmine-ea4bf1eba4b680159a873aa468364826f4d13385.tar.gz
redmine-ea4bf1eba4b680159a873aa468364826f4d13385.zip
Merged r22302 and r22303 from trunk to 5.0-stable (#38807).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22304 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index c292926a5..9062fca0d 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -841,7 +841,7 @@ class RedCloth3 < String
end
url = htmlesc(url.dup)
- next all if url.downcase.start_with?('javascript:')
+ next all unless uri_with_link_safe_scheme?(url)
atts = pba(atts)
atts = +" href=\"#{url}#{slash}\"#{atts}"
@@ -965,7 +965,7 @@ class RedCloth3 < String
next m unless uri_with_safe_scheme?(url.partition('?').first)
if href
href = htmlesc(href.dup)
- next m if href.downcase.start_with?('javascript:')
+ next m unless uri_with_link_safe_scheme?(href)
end
out = +''
@@ -1214,9 +1214,9 @@ class RedCloth3 < String
all, tag, close = $1, $2, $3
if close.present? && (ALLOWED_TAGS.include?(tag) || (tag =~ /\Aredpre#\d+\z/))
- "<#{all}#{close}"
+ "<#{htmlesc all}#{close}"
else
- "&lt;#{all}#{'&gt;' unless close.blank?}"
+ "&lt;#{htmlesc all}#{'&gt;' unless close.blank?}"
end
end
end