summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-02 15:16:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-02 15:16:17 +0000
commit7a969dafacf06f9079a925f69b62dbad81c3aba4 (patch)
tree3bf62043895575cde5bdf6aa3b743bdfd09a1f31 /lib
parent7f8d959171c571eaf1a49951a2da02ccffa6f808 (diff)
downloadredmine-7a969dafacf06f9079a925f69b62dbad81c3aba4.tar.gz
redmine-7a969dafacf06f9079a925f69b62dbad81c3aba4.zip
Escape HTML comment tags (#1160).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1403 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redcloth.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redcloth.rb b/lib/redcloth.rb
index 7e0c71839..7729ced46 100644
--- a/lib/redcloth.rb
+++ b/lib/redcloth.rb
@@ -1134,7 +1134,7 @@ class RedCloth < String
ALLOWED_TAGS = %w(redpre pre code)
def escape_html_tags(text)
- text.gsub!(%r{<(\/?(\w+)[^>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' if $3}" }
+ text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
end
end