summaryrefslogtreecommitdiffstats
path: root/Bugzilla/FlagType.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-01-23 17:13:37 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-01-23 17:13:37 +0100
commit96624a115fe60b8ebdbbecbc2b38a7566d4e4c59 (patch)
tree7b7c92645371edd42efe647c4c731f0a971f4e71 /Bugzilla/FlagType.pm
parent3d3cb31a1f4f7c09de165805298e4ea2feaba7cd (diff)
downloadbugzilla-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar.gz
bugzilla-96624a115fe60b8ebdbbecbc2b38a7566d4e4c59.tar.xz
Bug 319953: Missing real email syntax check
r=glob a=LpSolit
Diffstat (limited to 'Bugzilla/FlagType.pm')
-rw-r--r--Bugzilla/FlagType.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm
index ddaa6eb62..b4709212e 100644
--- a/Bugzilla/FlagType.pm
+++ b/Bugzilla/FlagType.pm
@@ -38,6 +38,8 @@ use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::Group;
+use Email::Address;
+
use base qw(Bugzilla::Object);
###############################
@@ -287,15 +289,11 @@ sub _check_cc_list {
|| ThrowUserError('flag_type_cc_list_invalid', { cc_list => $cc_list });
my @addresses = split(/[,\s]+/, $cc_list);
- # We do not call Util::validate_email_syntax because these
- # addresses do not require to match 'emailregexp' and do not
- # depend on 'emailsuffix'. So we limit ourselves to a simple
- # sanity check:
- # - match the syntax of a fully qualified email address;
- # - do not contain any illegal character.
+ my $addr_spec = $Email::Address::addr_spec;
+ # We do not call check_email_syntax() because these addresses do not
+ # require to match 'emailregexp' and do not depend on 'emailsuffix'.
foreach my $address (@addresses) {
- ($address =~ /^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$/
- && $address !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/)
+ ($address !~ /\P{ASCII}/ && $address =~ /^$addr_spec$/)
|| ThrowUserError('illegal_email_address',
{addr => $address, default => 1});
}