aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-19 09:15:35 -0700
committerLouise Crow <louise.crow@gmail.com>2013-06-19 09:15:35 -0700
commit16c39c7d7cbcd838c709943822b88009d17cda3f (patch)
tree44eba39ff404d1199ed5a60f26ace65a359847f0
parent45d0869d578e6f915efc50b8a500b7c0319ebc6e (diff)
parent2e588963bff5baf256cd2cdc0c8f615b12589edb (diff)
Merge branch 'hotfix/0.11.0.14' into rails-3-develop
-rw-r--r--app/models/incoming_message.rb2
-rw-r--r--spec/models/incoming_message_spec.rb10
2 files changed, 11 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index f959a8799..4910d43f4 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -713,7 +713,7 @@ class IncomingMessage < ActiveRecord::Base
text.strip!
# if there is nothing but quoted stuff, then show the subject
if text == "FOLDED_QUOTED_SECTION"
- text = "[Subject only] " + CGI.escapeHTML(self.subject) + text
+ text = "[Subject only] " + CGI.escapeHTML(self.subject || '') + text
end
# and display link for quoted stuff
text = text.gsub(/FOLDED_QUOTED_SECTION/, "\n\n" + '<span class="unfold_link"><a href="?unfold=1#incoming-'+self.id.to_s+'">'+_("show quoted sections")+'</a></span>' + "\n\n")
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb
index 76d7eba2e..3c924dcb3 100644
--- a/spec/models/incoming_message_spec.rb
+++ b/spec/models/incoming_message_spec.rb
@@ -115,6 +115,16 @@ describe IncomingMessage, " when dealing with incoming mail" do
end
+ it 'should handle a main body part that is just quoted content in an email that has
+ no subject' do
+ i = IncomingMessage.new
+ i.stub!(:get_main_body_text_unfolded).and_return("some quoting")
+ i.stub!(:get_main_body_text_folded).and_return("FOLDED_QUOTED_SECTION")
+ i.stub!(:subject).and_return(nil)
+ i.get_body_for_html_display
+ end
+
+
end
describe IncomingMessage, " display attachments" do