diff options
author | francis <francis> | 2009-10-02 23:31:01 +0000 |
---|---|---|
committer | francis <francis> | 2009-10-02 23:31:01 +0000 |
commit | 1e1d179ff92a99649aaa2c94beef6450e2c71c04 (patch) | |
tree | 6fa02c19ac1bc0887618927f9e7a524b3da451f1 /lib | |
parent | 0752af7fbd9dd7bfc7c6bba485f2261dc6ca8cef (diff) |
Better error message in admin interface if try to resend to invalid email.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tmail_extensions.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tmail_extensions.rb b/lib/tmail_extensions.rb index ef882e850..6e214df0e 100644 --- a/lib/tmail_extensions.rb +++ b/lib/tmail_extensions.rb @@ -4,7 +4,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: tmail_extensions.rb,v 1.6 2009-09-08 04:12:09 francis Exp $ +# $Id: tmail_extensions.rb,v 1.7 2009-10-02 23:31:01 francis Exp $ # Monkeypatch! @@ -41,6 +41,9 @@ module TMail # Monkeypatch! Constructor which makes a TMail::Address given # a name and an email def Address.address_from_name_and_email(name, email) + if !MySociety::Validate.is_valid_email(email) + raise "invalid email " + email + " passed to address_from_name_and_email" + end if name.nil? return TMail::Address.parse(email) end |