FIX: blank page on user page in rare cases

This commit is contained in:
Sam 2014-10-07 11:37:27 +11:00
parent b4c38dbc5a
commit dba1616762
1 changed files with 8 additions and 4 deletions

View File

@ -30,10 +30,14 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
end end
def escape_attribute(v) def escape_attribute(v)
v.gsub("&", "&amp;") return "" unless v
.gsub("\"", "&#34;")
.gsub("<", "&lt;") v = v.dup
.gsub(">", "&gt;") v.gsub!("&", "&amp;")
v.gsub!("\"", "&#34;")
v.gsub!("<", "&lt;")
v.gsub!(">", "&gt;")
v
end end
def include_tag(name, attributes) def include_tag(name, attributes)