aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/incoming_message.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 932329bd2..7616c1154 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,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.181 2009-01-14 16:46:02 francis Exp $
+# $Id: incoming_message.rb,v 1.182 2009-01-21 02:55:11 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -659,6 +659,11 @@ class IncomingMessage < ActiveRecord::Base
# Needed for e.g. http://www.whatdotheyknow.com/request/60/response/98
text = text.gsub(/\r\n/, "\n")
+ # Compress extra spaces down to save space, and to stop regular expressions
+ # breaking in strange extreme cases. e.g. for
+ # http://www.whatdotheyknow.com/request/spending_on_consultants
+ text = text.gsub(/ +/, " ")
+
return text
end
# Returns part which contains main body text, or nil if there isn't one