BigW Consortium Gitlab

Commit 4aabf707 by http://jneen.net/

rename `part` variable and guard against nil content_type

parent 64e98040
...@@ -23,15 +23,13 @@ module Gitlab ...@@ -23,15 +23,13 @@ module Gitlab
private private
def select_body(message) def select_body(message)
if message.multipart? part = if message.multipart?
text = message.text_part || message.html_part || message message.text_part || message.html_part || message
else else
text = message message
end end
return "" unless text decoded = fix_charset(part)
decoded = fix_charset(text)
return "" unless decoded return "" unless decoded
...@@ -40,7 +38,7 @@ module Gitlab ...@@ -40,7 +38,7 @@ module Gitlab
return "" return ""
end end
if text.content_type =~ %r(text/html) if (part.content_type || '').include? 'text/html'
HTMLParser.parse_reply(decoded) HTMLParser.parse_reply(decoded)
else else
decoded decoded
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment