Browse files

Fixes infinite loop in HtmlSanitizer

When the html parser hits a close </p> tag and it doesn't think its
inside a paragraph, it no longer loops endlessly. Now it throws away
the orphaned </p> tag and continues through the stream.
  • Loading branch information...
Michael Maltese
Michael Maltese committed Sep 16, 2011
1 parent f5c2e79 commit 8f7122377fa8c82aad0278d0e49954c0e8035662
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/sl_workflow_data/app/helpers/html_sanitizer.rb
@@ -61,6 +61,7 @@ def fix_paragraphs(s)
inside_p = true
elsif not inside_p and tokens.first == "</p>"
# weirddd
+ tokens.shift
elsif inside_p and tokens.first == "</p>"
fixed << tokens.shift
inside_p = false

0 comments on commit 8f71223

Please sign in to comment.