From dba1616762442af4ca48b6fd064766274c0aa477 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 7 Oct 2014 11:37:27 +1100 Subject: [PATCH] FIX: blank page on user page in rare cases --- lib/excerpt_parser.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/excerpt_parser.rb b/lib/excerpt_parser.rb index 133d0875f74..511daa7d872 100644 --- a/lib/excerpt_parser.rb +++ b/lib/excerpt_parser.rb @@ -30,10 +30,14 @@ class ExcerptParser < Nokogiri::XML::SAX::Document end def escape_attribute(v) - v.gsub("&", "&") - .gsub("\"", """) - .gsub("<", "<") - .gsub(">", ">") + return "" unless v + + v = v.dup + v.gsub!("&", "&") + v.gsub!("\"", """) + v.gsub!("<", "<") + v.gsub!(">", ">") + v end def include_tag(name, attributes)