$_[0] = $param;
}
}
- return $class->SUPER::new(@_);
+
+ $user = $class->SUPER::new(@_);
+
+ # MySQL considers some non-ascii characters such as umlauts to equal
+ # ascii characters returning a user when it should not.
+ if ($user && ref $param eq 'HASH' && exists $param->{name}) {
+ my $login = $param->{name};
+ if (lc $login ne lc $user->login) {
+ $user = undef;
+ }
+ }
+
+ return $user;
}
sub super_user {
use Scalar::Util qw(blessed);
use Bugzilla::Constants qw(AUTH_NODATA AUTH_ERROR USAGE_MODE_BROWSER);
-use Bugzilla::Util qw(generate_random_password);
+use Bugzilla::Util qw(generate_random_password validate_email_syntax);
use Bugzilla::Token qw(issue_short_lived_session_token set_token_extra_data);
use List::MoreUtils qw(any);
use Bugzilla::Extension::GitHubAuth::Client;
grep { $_->{verified} && $_->{email} !~ /\@users\.noreply\.github\.com$/ }
@$emails;
+ # Validate each email address similar to if we were creating the account locally
+ my @valid_emails;
+ foreach my $email (@emails) {
+ push @valid_emails, $email if validate_email_syntax($email);
+ }
+
my @bugzilla_users;
my @github_emails;
- foreach my $email (@emails) {
+ foreach my $email (@valid_emails) {
my $user = Bugzilla::User->new({name => $email, cache => 1});
if ($user) {
push @bugzilla_users, $user;