From: Dylan William Hardison Date: Wed, 5 Jul 2017 18:43:18 +0000 (-0700) Subject: Bug 1377933 - Remove trailing whitespace from all perl files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37722eca39874bb6abdcd120e3e458bd62dea62b;p=thirdparty%2Fbugzilla.git Bug 1377933 - Remove trailing whitespace from all perl files --- diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 068ba9e457..0bdb50c9ae 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -372,7 +372,7 @@ sub flag_types { my $vars = { target_type => 'attachment', product_id => $self->bug->product_id, component_id => $self->bug->component_id, - attach_id => $self->id, + attach_id => $self->id, active_or_has_flags => $self->bug_id }; return $self->{flag_types} = Bugzilla::Flag->_flag_types($vars); @@ -419,7 +419,7 @@ sub _check_bug { $bug = ref $invocant ? $invocant->bug : $bug; - $bug || ThrowCodeError('param_required', + $bug || ThrowCodeError('param_required', { function => "$invocant->create", param => 'bug' }); ($user->can_see_bug($bug->id) && $user->can_edit_product($bug->product_id)) @@ -430,7 +430,7 @@ sub _check_bug { sub _check_content_type { my ($invocant, $content_type, undef, $params) = @_; - + my $is_patch = ref($invocant) ? $invocant->ispatch : $params->{ispatch}; $content_type = 'text/plain' if $is_patch; $content_type = clean_text($content_type); diff --git a/Bugzilla/Attachment/PatchReader.pm b/Bugzilla/Attachment/PatchReader.pm index fb8b83392e..2cfbf2c6b4 100644 --- a/Bugzilla/Attachment/PatchReader.pm +++ b/Bugzilla/Attachment/PatchReader.pm @@ -269,8 +269,8 @@ sub setup_patch_readers { } # Add in cvs context if we have the necessary info to do it - if ($context ne 'patch' && Bugzilla->localconfig->{cvsbin} - && Bugzilla->params->{'cvsroot_get'}) + if ($context ne 'patch' && Bugzilla->localconfig->{cvsbin} + && Bugzilla->params->{'cvsroot_get'}) { require Bugzilla::PatchReader::AddCVSContext; # We need to set $cvsbin as global, because PatchReader::CVSClient @@ -301,7 +301,7 @@ sub setup_template_patch_reader { $vars->{'collapsed'} = $cgi->param('collapsed'); $vars->{'context'} = $context; - $vars->{'do_context'} = Bugzilla->localconfig->{cvsbin} + $vars->{'do_context'} = Bugzilla->localconfig->{cvsbin} && Bugzilla->params->{'cvsroot_get'} && !$vars->{'newid'}; # Print everything out. diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm index 522fbebf3e..797ec1122b 100644 --- a/Bugzilla/Auth.pm +++ b/Bugzilla/Auth.pm @@ -137,7 +137,7 @@ sub can_change_password { my $verifier = $self->{_verifier}->{successful}; $verifier ||= $self->{_verifier}; my $getter = $self->{_info_getter}->{successful}; - $getter = $self->{_info_getter} + $getter = $self->{_info_getter} if (!$getter || $getter->isa('Bugzilla::Auth::Login::Cookie')); return $verifier->can_change_password && $getter->user_can_create_account; @@ -219,7 +219,7 @@ sub _handle_login_result { } } elsif ($fail_code == AUTH_NODATA) { - $self->{_info_getter}->fail_nodata($self) + $self->{_info_getter}->fail_nodata($self) if $login_type == LOGIN_REQUIRED; # If we're not LOGIN_REQUIRED, we just return the default user. @@ -230,9 +230,9 @@ sub _handle_login_result { # the password was just wrong. (This makes it harder for a cracker # to find account names by brute force) elsif ($fail_code == AUTH_LOGINFAILED or $fail_code == AUTH_NO_SUCH_USER) { - my $remaining_attempts = MAX_LOGIN_ATTEMPTS + my $remaining_attempts = MAX_LOGIN_ATTEMPTS - ($result->{failure_count} || 0); - ThrowUserError("invalid_username_or_password", + ThrowUserError("invalid_username_or_password", { remaining => $remaining_attempts }); } # The account may be disabled @@ -247,18 +247,18 @@ sub _handle_login_result { elsif ($fail_code == AUTH_LOCKOUT) { my $attempts = $user->account_ip_login_failures; - # We want to know when the account will be unlocked. This is + # We want to know when the account will be unlocked. This is # determined by the 5th-from-last login failure (or more/less than # 5th, if MAX_LOGIN_ATTEMPTS is not 5). my $determiner = $attempts->[scalar(@$attempts) - MAX_LOGIN_ATTEMPTS]; - my $unlock_at = datetime_from($determiner->{login_time}, + my $unlock_at = datetime_from($determiner->{login_time}, Bugzilla->local_timezone); $unlock_at->add(minutes => LOGIN_LOCKOUT_INTERVAL); # If we were *just* locked out, notify the maintainer about the # lockout. if ($result->{just_locked_out}) { - # We're sending to the maintainer, who may be not a Bugzilla + # We're sending to the maintainer, who may be not a Bugzilla # account, but just an email address. So we use the # installation's default language for sending the email. my $default_settings = Bugzilla::User::Setting::get_defaults(); @@ -289,7 +289,7 @@ sub _handle_login_result { } $unlock_at->set_time_zone($user->timezone); - ThrowUserError('account_locked', + ThrowUserError('account_locked', { ip_addr => $determiner->{ip_addr}, unlock_at => $unlock_at }); } # If we get here, then we've run out of options, which shouldn't happen. @@ -314,11 +314,11 @@ Bugzilla::Auth - An object that authenticates the login credentials for Handles authentication for Bugzilla users. Authentication from Bugzilla involves two sets of modules. One set is -used to obtain the username/password (from CGI, email, etc), and the -other set uses this data to authenticate against the datasource +used to obtain the username/password (from CGI, email, etc), and the +other set uses this data to authenticate against the datasource (the Bugzilla DB, LDAP, PAM, etc.). -Modules for obtaining the username/password are subclasses of +Modules for obtaining the username/password are subclasses of L, and modules for authenticating are subclasses of L. @@ -342,11 +342,11 @@ An error occurred when trying to use the login mechanism. The hashref will also contain an C element, which is the name of an error from C