tighten interest email validation rule
authorAdrian Oldham <adriann@visualthought.com.au>
Wed, 28 Jan 2015 02:17:44 +0000 (13:17 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 29 Jan 2015 23:23:50 +0000 (10:23 +1100)
site/cgi-bin/modules/BSE/UI/Interest.pm

index 58e7a14..9abaa1a 100644 (file)
@@ -5,7 +5,7 @@ use BSE::ComposeMail;
 use BSE::TB::Products;
 use BSE::Util::Tags qw(tag_object);
 
-our $VERSION = "1.001";
+our $VERSION = "1.002";
 
 my %actions =
   (
@@ -82,7 +82,7 @@ sub req_interest {
   if (!defined $useremail || $useremail !~ /\S/) {
     $errors{email} = "msg:bse/interest/noemail";
   }
-  elsif ($useremail !~ /.\@./) {
+  elsif ($useremail !~ /^[^\s\@][^\@]*\@[\w.-]+\.\w+$/) {
     $errors{email} = "msg:bse/interest/bademail";
   }