Fix multiple email handling in the Inbox.
Put an email regex into WebGUI::Utility, and use it in Form/Email and Account/Inbox.
This commit is contained in:
parent
4bf3f457de
commit
29759ede9c
6 changed files with 111 additions and 53 deletions
|
|
@ -17,6 +17,7 @@ package WebGUI::Form::Email;
|
|||
use strict;
|
||||
use base 'WebGUI::Form::Text';
|
||||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ An optional value to process instead of POST input.
|
|||
sub getValue {
|
||||
my $self = shift;
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^[0-9a-z._%+-]+@(?:[0-9a-z-]+\.)+[a-z]{2,9}$/i) {
|
||||
if ($value =~ WebGUI::Utility::emailRegex) {
|
||||
return $value;
|
||||
}
|
||||
return undef;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue