aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/censor_rule.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-04-08 05:34:51 +0000
committerfrancis <francis>2009-04-08 05:34:51 +0000
commit2424bdf7da5346a6bf28dbaf9ff4d9bfd70b070c (patch)
tree80e1bc7adb4bf633ecd093357531f36fc199ba88 /app/models/censor_rule.rb
parent14b2c6e814484a76e52cc8108fa8bdf8081606cc (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/censor_rule.rb')
-rw-r--r--app/models/censor_rule.rb6
1 files changed, 3 insertions, 3 deletions
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