diff options
-rw-r--r-- | app/helpers/link_to_helper.rb | 4 | ||||
-rw-r--r-- | app/models/censor_rule.rb | 6 | ||||
-rw-r--r-- | app/models/incoming_message.rb | 7 | ||||
-rw-r--r-- | app/models/info_request_event.rb | 4 | ||||
-rw-r--r-- | app/views/admin_request/show_raw_email.rhtml | 2 | ||||
-rw-r--r-- | app/views/track_mailer/event_digest.rhtml | 2 |
6 files changed, 12 insertions, 13 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 8fdb092ae..9c0713435 100644 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: link_to_helper.rb,v 1.51 2009-04-03 14:07:46 louise Exp $ +# $Id: link_to_helper.rb,v 1.52 2009-04-08 05:34:51 francis Exp $ module LinkToHelper @@ -145,7 +145,7 @@ module LinkToHelper # and also 3.3 of http://www.ietf.org/rfc/rfc2396.txt # It turns out this is a regression in Rails 2.1, caused by this bug fix: # http://rails.lighthouseapp.com/projects/8994/tickets/144-patch-bug-in-rails-route-globbing - url.gsub!("%2F", "/") + url = url.gsub("%2F", "/") if !postfix.nil? && !postfix.empty? url = url + "/" + postfix diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb index de8c699a6..18a962dfc 100644 --- a/app/models/censor_rule.rb +++ b/app/models/censor_rule.rb @@ -21,7 +21,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: censor_rule.rb,v 1.9 2009-03-09 15:48:32 tony Exp $ +# $Id: censor_rule.rb,v 1.10 2009-04-08 05:34:52 francis Exp $ class CensorRule < ActiveRecord::Base belongs_to :info_request @@ -32,7 +32,7 @@ class CensorRule < ActiveRecord::Base if text.nil? return nil end - text.gsub!(self.text, self.replacement) + text = text.gsub(self.text, self.replacement) return text end def apply_to_binary(binary) @@ -40,7 +40,7 @@ class CensorRule < ActiveRecord::Base return nil end replacement = self.text.gsub(/./, 'x') - binary.gsub!(self.text, replacement) + binary = binary.gsub(self.text, replacement) return binary end 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 diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index ef8bff164..efb58930b 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.77 2009-03-09 15:48:32 tony Exp $ +# $Id: info_request_event.rb,v 1.78 2009-04-08 05:34:52 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -106,7 +106,7 @@ class InfoRequestEvent < ActiveRecord::Base url_title = self.info_request.url_title # remove numeric section from the end, use this to group lots # of similar requests by - url_title.gsub!(/[_0-9]+$/, "") + url_title = url_title.gsub(/[_0-9]+$/, "") return url_title end def described_at diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml index 011341c99..fa2a4f9e6 100644 --- a/app/views/admin_request/show_raw_email.rhtml +++ b/app/views/admin_request/show_raw_email.rhtml @@ -22,5 +22,5 @@ <%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %> -<pre><%=h(@raw_email.data).gsub!(/\n/, '<br>') %></pre> +<pre><%=h(@raw_email.data).gsub(/\n/, '<br>') %></pre> diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index 4f112f257..214b47aca 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -44,7 +44,7 @@ else extract = highlight_and_excerpt(info_request.initial_request_text, @highlight_words, 150, false) end - extract.gsub!(/\s+/, ' ') + extract = extract.gsub(/\s+/, ' ') main_text += MySociety::Format.wrap_email_body('"' + extract + '"').gsub(/\n+$/, "") + "\n" # Link to the request/response |