]> source.dussan.org Git - redmine.git/commitdiff
Merged r18247 to 3.4-stable (#31520).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 10 Jun 2019 11:49:48 +0000 (11:49 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 10 Jun 2019 11:49:48 +0000 (11:49 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@18249 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/redcloth3.rb

index fc71d5929a9072d61531eedca9b459f574c0e7b7..5716e7d5c2f9d3a2402ac58e3c794a5f3d795c87 100644 (file)
@@ -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