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
def escape_attribute(v)
v.gsub("&", "&amp;")
.gsub("\"", "&#34;")
.gsub("<", "&lt;")
.gsub(">", "&gt;")
return "" unless v
v = v.dup
v.gsub!("&", "&amp;")
v.gsub!("\"", "&#34;")
v.gsub!("<", "&lt;")
v.gsub!(">", "&gt;")
v
end
def include_tag(name, attributes)