summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-10 11:49:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-10 11:49:48 +0000
commit90ee0d29027e4487f2171661c9d4e893b3067749 (patch)
treee38809314f957a34988a0930f0e155f4955d3717
parent92a74472f3a8e84c13fd3f070b435605731e5755 (diff)
downloadredmine-90ee0d29027e4487f2171661c9d4e893b3067749.tar.gz
redmine-90ee0d29027e4487f2171661c9d4e893b3067749.zip
Merged r18247 to 3.4-stable (#31520).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@18249 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/wiki_formatting/textile/redcloth3.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb
index fc71d5929..5716e7d5c 100644
--- a/lib/redmine/wiki_formatting/textile/redcloth3.rb
+++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb
@@ -1213,7 +1213,13 @@ class RedCloth3 < String
ALLOWED_TAGS = %w(redpre pre code kbd notextile)
def escape_html_tags(text)
- text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
+ text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) do |m|
+ if ALLOWED_TAGS.include?($2) && $3.present?
+ "<#{$1}#{$3}"
+ else
+ "&lt;#{$1}#{'&gt;' unless $3.blank?}"
+ end
+ end
end
end