aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-03-14 19:44:17 +0000
committerfrancis <francis>2008-03-14 19:44:17 +0000
commitb703f980c7bcdd5c3be7975fa162abefe1cee0f1 (patch)
tree425c6df4aa281fe7c5423c6837d4ca0d535c3447
parent5725f62e768130b323dc24d1cb8a086bb50ad1bf (diff)
Cope with text parts of emails have DOS style line endings.
-rw-r--r--app/models/incoming_message.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index f098660bb..375f1d9e7 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -18,7 +18,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.58 2008-03-13 11:29:47 francis Exp $
+# $Id: incoming_message.rb,v 1.59 2008-03-14 19:44:17 francis Exp $
# TODO
@@ -245,6 +245,10 @@ class IncomingMessage < ActiveRecord::Base
end
end
+ # Fix DOS style linefeeds to Unix style ones (or other later regexps won't work)
+ # Needed for e.g. http://www.whatdotheyknow.com/request/60/response/98
+ text = text.gsub!(/\r\n/, "\n")
+
return text
end
# Returns part which contains main body text