Fix dtext.parse_strip failing for nil (closes #2662)

This commit is contained in:
Type-kun
2016-09-08 22:47:42 +05:00
parent 06ddb16843
commit 756881966a

View File

@@ -339,6 +339,8 @@ class DText
end end
def self.strip(s) def self.strip(s)
return "" if s.blank?
s.gsub!(/[\r\n]+/m, " ") s.gsub!(/[\r\n]+/m, " ")
s.gsub!(/\[\/?(?:b|i|s|u|tn|tr|td|th|thead|tbody|quote|code|spoilers|spoiler|expand|table)\]/, "") s.gsub!(/\[\/?(?:b|i|s|u|tn|tr|td|th|thead|tbody|quote|code|spoilers|spoiler|expand|table)\]/, "")
s.gsub!(/\[\[([^\|\]]+)\|([^\]]+)\]\]/m, '\2') s.gsub!(/\[\[([^\|\]]+)\|([^\]]+)\]\]/m, '\2')