disallow leading whitespace on email validation rule
authorAdrian Oldham <adriann@visualthought.com.au>
Tue, 18 Feb 2014 22:48:07 +0000 (09:48 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 25 Feb 2014 23:00:08 +0000 (10:00 +1100)
site/cgi-bin/modules/DevHelp/Validate.pm

index dbdc071f1cb7ae8214b061fd023d961fea2e4e9a..c8d2d2936277fe00c5c136681d8ae855a0198b48 100644 (file)
@@ -6,7 +6,7 @@ use vars qw(@EXPORT_OK @ISA);
 @ISA = qw(Exporter);
 use Carp qw(confess);
 
-our $VERSION = "1.006";
+our $VERSION = "1.007";
 
 my $re_real =
   qr/
@@ -25,7 +25,7 @@ my %built_ins =
   (
    email => 
    {
-    match => qr/^[^\@]+\@[\w.-]+\.\w+$/,
+    match => qr/^[^\s\@][^\@]*\@[\w.-]+\.\w+$/,
     error => '$n is not a valid email address',
    },
    phone =>