summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2016-04-27 18:50:13 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2016-04-27 18:50:13 +0200
commit3891b63a1eb52076337885487f251a10580a4a85 (patch)
treedb1463894b756a6bb5114644feeec704ec886eb5 /Bugzilla/Util.pm
parentc44470a368465adfe329fcfc32492829a21878da (diff)
downloadbugzilla-3891b63a1eb52076337885487f251a10580a4a85.tar.gz
bugzilla-3891b63a1eb52076337885487f251a10580a4a85.tar.xz
Bug 218917 - Allow the login name to be different from the email address
Original patch by Gervase Markham r=gerv a=dkl
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index 06022ce7c..e673a920e 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -690,9 +690,8 @@ sub generate_random_password {
}
sub validate_email_syntax {
- my ($addr) = @_;
+ my ($email) = @_;
my $match = Bugzilla->params->{'emailregexp'};
- my $email = $addr . Bugzilla->params->{'emailsuffix'};
# This regexp follows RFC 2822 section 3.4.1.
my $addr_spec = $Email::Address::addr_spec;
# RFC 2822 section 2.1 specifies that email addresses must
@@ -700,7 +699,7 @@ sub validate_email_syntax {
# Email::Address::addr_spec doesn't enforce this.
# We set the max length to 127 to ensure addresses aren't truncated when
# inserted into the tokens.eventdata field.
- if ($addr =~ /$match/
+ if ($email =~ /$match/
&& $email !~ /\P{ASCII}/
&& $email =~ /^$addr_spec$/
&& length($email) <= 127)
@@ -713,11 +712,10 @@ sub validate_email_syntax {
}
sub check_email_syntax {
- my ($addr) = @_;
+ my ($email) = @_;
unless (validate_email_syntax(@_)) {
- my $email = $addr . Bugzilla->params->{'emailsuffix'};
- ThrowUserError('illegal_email_address', { addr => $email });
+ ThrowUserError('illegal_email_address', { email => $email });
}
}