diff options
author | francis <francis> | 2009-04-08 05:34:51 +0000 |
---|---|---|
committer | francis <francis> | 2009-04-08 05:34:51 +0000 |
commit | 2424bdf7da5346a6bf28dbaf9ff4d9bfd70b070c (patch) | |
tree | 80e1bc7adb4bf633ecd093357531f36fc199ba88 /app/models/incoming_message.rb | |
parent | 14b2c6e814484a76e52cc8108fa8bdf8081606cc (diff) |
Remove some uses of gsub!, which might be clobbering other versions of strings
which are really members of some other class
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r-- | app/models/incoming_message.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 002914bca..819d6c5b5 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.197 2009-04-08 05:29:35 francis Exp $ +# $Id: incoming_message.rb,v 1.198 2009-04-08 05:34:52 francis Exp $ # TODO # Move some of the (e.g. quoting) functions here into rblib, as they feel @@ -241,7 +241,7 @@ class FOIAttachment filename = self._internal_display_filename # Remove slashes, they mess with URLs - filename.gsub!(/\//, "-") + filename = filename.gsub(/\//, "-") return filename end @@ -619,7 +619,6 @@ class IncomingMessage < ActiveRecord::Base return text end - # Flattens all the attachments, picking only one part where there are alternatives. # (This risks losing info if the unchosen alternative is the only one to contain # useful info, but let's worry about that another time) def get_attachment_leaves @@ -724,7 +723,7 @@ class IncomingMessage < ActiveRecord::Base begin # XXX specially convert unicode pound signs, was needed here # http://www.whatdotheyknow.com/request/88/response/352 - text.gsub!("£", Iconv.conv(text_charset, 'utf-8', '£')) + text = text.gsub("£", Iconv.conv(text_charset, 'utf-8', '£')) # Try proper conversion text = Iconv.conv('utf-8', text_charset, text) rescue Iconv::IllegalSequence, Iconv::InvalidEncoding |