aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-06-11 15:00:35 +0000
committerfrancis <francis>2008-06-11 15:00:35 +0000
commit50ef06b630cd9847c68ab36e459d879b51539fe6 (patch)
treef460014ffbf9db241a18baea95ddc1f2cdf0c78c /app/models/info_request.rb
parent75be1213513666c720c3b4a7f3c06a0d9d2b5e6b (diff)
Cope with mistyped l instead of 1, and o instead of 0 in request emails.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index f80876813..33fc87357 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.116 2008-06-11 00:05:44 francis Exp $
+# $Id: info_request.rb,v 1.117 2008-06-11 15:00:35 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -188,7 +188,7 @@ public
# the prefix and domain, as sometimes those change, or might be elided by
# copying an email, and that doesn't matter)
def InfoRequest.find_by_incoming_email(incoming_email)
- # Match case insensitively
+ # Match case insensitively, FOI officers often write Request with capital R.
incoming_email = incoming_email.downcase
# The optional bounce- dates from when we used to have separate emails for the envelope from.
@@ -198,6 +198,13 @@ public
id = $1.to_i
hash = $2
+ if not hash.nil?
+ # Convert l to 1, and o to 0. FOI officers quite often retype the
+ # email address and make this kind of error.
+ hash.gsub!(/l/, "1")
+ hash.gsub!(/o/, "0")
+ end
+
return self.find_by_magic_email(id, hash)
end