Commit 2415f602 authored by jplang's avatar jplang

Fix html encoding (#31520).

git-svn-id: https://svn.redmine.org/redmine/trunk@18247 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 518c48b7
......@@ -1215,7 +1215,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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment