diff options
Diffstat (limited to 'Bugzilla')
50 files changed, 167 insertions, 182 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 326534dd8..26f768c2f 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -76,7 +76,7 @@ use constant DB_COLUMNS => qw( submitter_id ); -use constant REQUIRED_FIELD_MAP => {bug_id => 'bug',}; +use constant REQUIRED_FIELD_MAP => {bug_id => 'bug',}; use constant EXTRA_REQUIRED_FIELDS => qw(data); use constant UPDATE_COLUMNS => qw( diff --git a/Bugzilla/Auth/Verify/DB.pm b/Bugzilla/Auth/Verify/DB.pm index 951aaaf9f..6ed9ba15c 100644 --- a/Bugzilla/Auth/Verify/DB.pm +++ b/Bugzilla/Auth/Verify/DB.pm @@ -23,7 +23,7 @@ sub check_credentials { my $dbh = Bugzilla->dbh; my $username = $login_data->{username}; - my $user = new Bugzilla::User({name => $username}); + my $user = new Bugzilla::User({name => $username}); return {failure => AUTH_NO_SUCH_USER} unless $user; diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index d4e022336..bce3661f1 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -208,7 +208,7 @@ sub UPDATE_COLUMNS { my @custom = grep { $_->type != FIELD_TYPE_MULTI_SELECT } Bugzilla->active_custom_fields; my @custom_names = map { $_->name } @custom; - my @columns = qw( + my @columns = qw( assigned_to bug_file_loc bug_severity @@ -313,10 +313,10 @@ sub new { # make it the "name" param. if ( !defined $param || (!ref($param) && $param !~ /^[0-9]+$/) - || (ref($param) && $param->{id} !~ /^[0-9]+$/)) + || (ref($param) && $param->{id} !~ /^[0-9]+$/)) { if ($param) { - my $alias = ref($param) ? $param->{id} : $param; + my $alias = ref($param) ? $param->{id} : $param; my $bug_id = bug_alias_to_id($alias); if (!$bug_id) { my $error_self = {}; @@ -365,7 +365,7 @@ sub initialize { sub object_cache_key { my $class = shift; - my $key = $class->SUPER::object_cache_key(@_) || return; + my $key = $class->SUPER::object_cache_key(@_) || return; return $key . ',' . Bugzilla->user->id; } @@ -467,7 +467,7 @@ sub match { # so include them in the list if they have been specified. if (exists $params->{"${field}_id"}) { my $current_ids = $params->{"${field}_id"}; - my @id_array = ref $current_ids ? @$current_ids : ($current_ids); + my @id_array = ref $current_ids ? @$current_ids : ($current_ids); push(@ids, @id_array); } @@ -556,7 +556,7 @@ sub _extract_bug_ids { push @bug_ids, $comment->extra_data; next; } - my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; + my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; my $text = $comment->body; # Full bug links @@ -803,7 +803,7 @@ sub create { if ($see_also) { my $see_also_array = $see_also; if (!ref $see_also_array) { - $see_also = trim($see_also); + $see_also = trim($see_also); $see_also_array = [split(/[\s,]+/, $see_also)]; } foreach my $value (@$see_also_array) { @@ -1893,7 +1893,7 @@ sub _check_keywords { my $keyword_array = $keywords_in; if (!ref $keyword_array) { - $keywords_in = trim($keywords_in); + $keywords_in = trim($keywords_in); $keyword_array = [split(/[\s,]+/, $keywords_in)]; } @@ -1956,7 +1956,7 @@ sub _check_qa_contact { my $id; if ($qa_contact) { $qa_contact = Bugzilla::User->check($qa_contact) if !ref $qa_contact; - $id = $qa_contact->id; + $id = $qa_contact->id; # create() checks this another way, so we don't have to run this # check during create(). @@ -2017,7 +2017,7 @@ sub _check_resolution { && scalar @$dependson ) { - my $dep_bugs = Bugzilla::Bug->new_from_list($dependson); + my $dep_bugs = Bugzilla::Bug->new_from_list($dependson); my $count_open = grep { $_->isopened } @$dep_bugs; if ($count_open) { my $bug_id = ref($invocant) ? $invocant->id : undef; @@ -2641,7 +2641,7 @@ sub set_dependencies { my ($self, $dependson, $blocked) = @_; my %extra = (blocked => $blocked); $dependson = $self->_check_dependencies($dependson, 'dependson', \%extra); - $blocked = $extra{blocked}; + $blocked = $extra{blocked}; # These may already be detainted, but all setters are supposed to # detaint their input if they've run a validator (just as though @@ -3051,7 +3051,7 @@ sub add_comment { $params ||= {}; # Fill out info that doesn't change and callers may not pass in - $params->{'bug_id'} = $self; + $params->{'bug_id'} = $self; $params->{'thetext'} = defined($comment) ? $comment : ''; # Validate all the entered data @@ -3139,7 +3139,7 @@ sub add_group { # So we have to store and pass the name as entered by the user to # the error message, if we have it. my $group_name = blessed($group) ? $group->name : $group; - my $args = { + my $args = { name => $group_name, product => $self->product, bug_id => $self->id, @@ -3175,7 +3175,7 @@ sub remove_group { # See add_group() for the reason why we store the user input. my $group_name = blessed($group) ? $group->name : $group; - my $args = { + my $args = { name => $group_name, product => $self->product, bug_id => $self->id, @@ -4443,7 +4443,7 @@ sub LogActivityEntry { if (length($removestr) > MAX_LINE_LENGTH) { my $commaposition = find_wrap_point($removed, MAX_LINE_LENGTH); $removestr = substr($removed, 0, $commaposition); - $removed = substr($removed, $commaposition); + $removed = substr($removed, $commaposition); } else { $removed = ""; # no more entries @@ -4451,7 +4451,7 @@ sub LogActivityEntry { if (length($addstr) > MAX_LINE_LENGTH) { my $commaposition = find_wrap_point($added, MAX_LINE_LENGTH); $addstr = substr($added, 0, $commaposition); - $added = substr($added, $commaposition); + $added = substr($added, $commaposition); } else { $added = ""; # no more entries @@ -4758,7 +4758,7 @@ sub ValidateDependencies { @{$deps{$target}} = @{$deptree{$target}}; my @stack = @{$deps{$target}}; while (@stack) { - my $i = shift @stack; + my $i = shift @stack; my $dep_list = $dbh->selectcol_arrayref($sth{$target}, undef, $i); foreach my $t (@$dep_list) { diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 90eed0d8e..18795d735 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -59,7 +59,7 @@ sub Send { # Bugzilla::User objects of people in various roles. More than one person # can 'have' a role, if the person in that role has changed, or people are # watching. - my @assignees = ($bug->assigned_to); + my @assignees = ($bug->assigned_to); my @qa_contacts = $bug->qa_contact || (); my @ccs = @{$bug->cc_users}; @@ -455,7 +455,7 @@ sub _flatten_object { # the same objects are used for each recipient, so cache the flattened hash my $cache = Bugzilla->request_cache->{bugmail_flat_objects} ||= {}; - my $key = blessed($object) . '-' . $object->id; + my $key = blessed($object) . '-' . $object->id; return $cache->{$key} ||= $object->flatten_to_hash; } @@ -559,7 +559,7 @@ sub _get_diffs { && $diff->{field_name} eq $changes[-1]->{field_name} && $diff->{bug_when} eq $changes[-1]->{bug_when} && $diff->{who} eq $changes[-1]->{who} - && ($diff->{attach_id} // 0) == ($changes[-1]->{attach_id} // 0) + && ($diff->{attach_id} // 0) == ($changes[-1]->{attach_id} // 0) && ($diff->{comment_id} // 0) == ($changes[-1]->{comment_id} // 0)) { my $old_change = pop @changes; @@ -575,7 +575,7 @@ sub _get_diffs { } sub _get_new_bugmail_fields { - my $bug = shift; + my $bug = shift; my @fields = @{Bugzilla->fields({obsolete => 0, in_new_bugmail => 1})}; my @diffs; my $params = Bugzilla->params; diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm index 255be8623..c3e11e4c7 100644 --- a/Bugzilla/BugUrl.pm +++ b/Bugzilla/BugUrl.pm @@ -83,7 +83,7 @@ sub new { if (ref $param) { my $bug_id = $param->{bug_id}; - my $name = $param->{name} || $param->{value}; + my $name = $param->{name} || $param->{value}; if (!defined $bug_id) { ThrowCodeError('bad_arg', {argument => 'bug_id', function => "${class}::new"}); } @@ -92,7 +92,7 @@ sub new { } my $condition = 'bug_id = ? AND value = ?'; - my @values = ($bug_id, $name); + my @values = ($bug_id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index a4319be07..019fb8d10 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -35,10 +35,8 @@ sub _init_bz_cgi_globals { # We don't precompile any functions here, that's done specially in # mod_perl code. - $invocant->_setup_symbols( - qw(:no_xhtml :oldstyle_urls :private_tempfiles - :unique_headers) - ); + $invocant->_setup_symbols(qw(:no_xhtml :oldstyle_urls :private_tempfiles + :unique_headers)); } BEGIN { __PACKAGE__->_init_bz_cgi_globals() if i_am_cgi(); } @@ -357,7 +355,7 @@ sub _prevent_unsafe_response { my $is_safe_content_type = $content_type =~ $safe_content_type_re; # Safe referers are ones that begin with the urlbase. - my $referer = $self->referer; + my $referer = $self->referer; my $is_safe_referer = $referer && $referer =~ $safe_referer_re; if (!$is_safe_referer && !$is_safe_content_type) { diff --git a/Bugzilla/Chart.pm b/Bugzilla/Chart.pm index 3aee1aafb..1abf3dbe4 100644 --- a/Bugzilla/Chart.pm +++ b/Bugzilla/Chart.pm @@ -27,7 +27,7 @@ use List::Util qw(max); sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; # Create a ref to an empty hash and bless it my $self = {}; @@ -255,7 +255,7 @@ sub readData { my $sth = $dbh->prepare($query); - my $gt_index = $self->{'gt'} ? scalar(@{$self->{'lines'}}) : undef; + my $gt_index = $self->{'gt'} ? scalar(@{$self->{'lines'}}) : undef; my $line_index = 0; $maxvals[$gt_index] = 0 if $gt_index; diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index 02a044ff5..575703b4b 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -305,7 +305,7 @@ sub remove_tag { my ($self, $tag) = @_; $tag = $self->_check_tag($tag); - my $tags = $self->tags; + my $tags = $self->tags; my $index = first { lc($tags->[$_]) eq lc($tag) } 0 .. scalar(@$tags) - 1; return unless defined $index; splice(@$tags, $index, 1); diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 3cdee9d63..ef8180eb0 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -83,7 +83,7 @@ sub new { } my $condition = 'product_id = ? AND name = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 756dbb0dd..a0077b5b2 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -104,7 +104,7 @@ sub check_sslbase { my $proto = getprotobyname('tcp'); socket(SOCK, PF_INET, SOCK_STREAM, $proto); my $iaddr = inet_aton($host) || return "The host $host cannot be resolved"; - my $sin = sockaddr_in($port, $iaddr); + my $sin = sockaddr_in($port, $iaddr); if (!connect(SOCK, $sin)) { return "Failed to connect to $host:$port ($!); unable to enable SSL"; } @@ -115,7 +115,7 @@ sub check_sslbase { sub check_ip { my $inbound_proxies = shift; - my @proxies = split(/[\s,]+/, $inbound_proxies); + my @proxies = split(/[\s,]+/, $inbound_proxies); foreach my $proxy (@proxies) { validate_ip($proxy) || return "$proxy is not a valid IPv4 or IPv6 address"; } @@ -176,7 +176,7 @@ sub check_opsys { } sub check_bug_status { - my $bug_status = shift; + my $bug_status = shift; my @closed_bug_statuses = map { $_->name } closed_bug_statuses(); if (!grep($_ eq $bug_status, @closed_bug_statuses)) { return "Must be a valid closed status: one of " diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 029e05f03..c528e77d1 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -202,7 +202,7 @@ sub bz_check_server_version { my $sql_vers = $self->bz_server_version; $self->disconnect; - my $sql_want = $db->{db_version}; + my $sql_want = $db->{db_version}; my $version_ok = vers_cmp($sql_vers, $sql_want) > -1 ? 1 : 0; my $sql_server = $db->{name}; @@ -238,7 +238,7 @@ sub bz_create_database { # See if we can connect to the actual Bugzilla database. my $conn_success = eval { $dbh = connect_main() }; - my $db_name = Bugzilla->localconfig->{db_name}; + my $db_name = Bugzilla->localconfig->{db_name}; if (!$conn_success) { $dbh = _get_no_db_connection(); @@ -1136,7 +1136,7 @@ sub _bz_schema { my ($self) = @_; return $self->{private_bz_schema} if exists $self->{private_bz_schema}; my @module_parts = split('::', ref $self); - my $module_name = pop @module_parts; + my $module_name = pop @module_parts; $self->{private_bz_schema} = Bugzilla::DB::Schema->new($module_name); return $self->{private_bz_schema}; } @@ -1499,7 +1499,7 @@ sub _bz_populate_enum_table { my $insert = $self->prepare("INSERT INTO $sql_table (value,sortkey) VALUES (?,?)"); my $sortorder = 0; - my $maxlen = max(map(length($_), @$valuelist)) + 2; + my $maxlen = max(map(length($_), @$valuelist)) + 2; foreach my $value (@$valuelist) { $sortorder += 100; $insert->execute($value, $sortorder); diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 96a1fcb21..a58d88df4 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -283,7 +283,7 @@ sub bz_explain { $i++; } - my $first_row = sprintf($format_string, @$columns); + my $first_row = sprintf($format_string, @$columns); my @explain_rows = ($first_row, '-' x length($first_row)); while (my $row = $sth->fetchrow_arrayref) { my @fixed = map { defined $_ ? $_ : 'NULL' } @$row; @@ -328,7 +328,7 @@ sub bz_setup_database { # This parameter is not yet defined when the DB is being built for # the very first time. The code below still works properly, however, # because the default maxattachmentsize is smaller than $min_max_allowed. - my $max_attachment = (Bugzilla->params->{'maxattachmentsize'} || 0) * 1024; + my $max_attachment = (Bugzilla->params->{'maxattachmentsize'} || 0) * 1024; my $needed_max_allowed = max($min_max_allowed, $max_attachment); if ($current_max_allowed < $needed_max_allowed) { warn install_string('max_allowed_packet', @@ -737,7 +737,7 @@ sub bz_setup_database { my ($binary, $utf8) = ($sql_def, $sql_def); my $type = $self->_bz_schema->convert_type($col_info->{TYPE}); $binary =~ s/(\Q$type\E)/$1 CHARACTER SET binary/; - $utf8 =~ s/(\Q$type\E)/$1 CHARACTER SET utf8/; + $utf8 =~ s/(\Q$type\E)/$1 CHARACTER SET utf8/; push(@binary_sql, "MODIFY COLUMN $name $binary"); push(@utf8_sql, "MODIFY COLUMN $name $utf8"); } @@ -809,13 +809,13 @@ sub bz_setup_database { # looks like. So we remove defaults from columns that aren't supposed # to have them sub _fix_defaults { - my $self = shift; + my $self = shift; my $maj_version = substr($self->bz_server_version, 0, 1); return if $maj_version < 5; # The oldest column that could have this problem is bugs.assigned_to, # so if it doesn't have the problem, we just skip doing this entirely. - my $assi_def = $self->_bz_raw_column_info('bugs', 'assigned_to'); + my $assi_def = $self->_bz_raw_column_info('bugs', 'assigned_to'); my $assi_default = $assi_def->{COLUMN_DEF}; # This "ne ''" thing is necessary because _raw_column_info seems to @@ -834,7 +834,7 @@ sub _fix_defaults { # Get the exact default from the database without any # "fixing" by bz_column_info_real. - my $raw_info = $self->_bz_raw_column_info($table, $column); + my $raw_info = $self->_bz_raw_column_info($table, $column); my $raw_default = $raw_info->{COLUMN_DEF}; if (defined $raw_default) { if ($raw_default eq '') { @@ -856,7 +856,7 @@ sub _fix_defaults { print "Fixing defaults...\n"; foreach my $table (reverse sort keys %fix_columns) { my @alters = map("ALTER COLUMN $_ DROP DEFAULT", @{$fix_columns{$table}}); - my $sql = "ALTER TABLE $table " . join(',', @alters); + my $sql = "ALTER TABLE $table " . join(',', @alters); $self->do($sql); } } diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 337a0b5ba..930270ccc 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -310,7 +310,7 @@ sub adjust_statement { # Oracle requires a FROM clause in all SELECT statements, so append # "FROM dual" to queries without one (e.g., "SELECT NOW()") my $is_select = ($part =~ m/^\s*SELECT\b/io); - my $has_from = ($part =~ m/\bFROM\b/io) if $is_select; + my $has_from = ($part =~ m/\bFROM\b/io) if $is_select; # Oracle includes the time in CURRENT_DATE. $part =~ s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io; @@ -669,7 +669,7 @@ sub bz_setup_database { # triggers ourselves. if ($def->{TYPE} =~ /SERIAL/i) { my $sequence = "${table}_${column}_SEQ"; - my $exists = $self->selectrow_array($sth, undef, $sequence); + my $exists = $self->selectrow_array($sth, undef, $sequence); if (!$exists) { my @sql = $self->_get_create_seq_ddl($table, $column); $self->do($_) foreach @sql; @@ -688,7 +688,7 @@ sub bz_setup_database { $to_table = 'tag'; } if ($update =~ /CASCADE/i) { - my $trigger_name = uc($fk_name . "_UC"); + my $trigger_name = uc($fk_name . "_UC"); my $exist_trigger = $self->selectcol_arrayref($sth, undef, $trigger_name); if (@$exist_trigger) { $self->do("DROP TRIGGER $trigger_name"); @@ -713,7 +713,7 @@ sub bz_setup_database { } # Drop the trigger which causes bug 541553 - my $trigger_name = "PRODUCTS_MILESTONEURL"; + my $trigger_name = "PRODUCTS_MILESTONEURL"; my $exist_trigger = $self->selectcol_arrayref($sth, undef, $trigger_name); if (@$exist_trigger) { $self->do("DROP TRIGGER $trigger_name"); diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 4fc9ce8e2..0ca4a386f 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -2048,7 +2048,7 @@ sub _column_fks_to_ddl { my ($self, $table, $column_fks) = @_; my @ddl; foreach my $column (keys %$column_fks) { - my $def = $column_fks->{$column}; + my $def = $column_fks->{$column}; my $fk_string = $self->get_fk_ddl($table, $column, $def); push(@ddl, $fk_string); } @@ -2147,7 +2147,7 @@ sub get_table_columns { sub get_table_indexes_abstract { my ($self, $table) = @_; my $table_def = $self->get_table_abstract($table); - my %indexes = @{$table_def->{INDEXES} || []}; + my %indexes = @{$table_def->{INDEXES} || []}; return \%indexes; } @@ -2217,7 +2217,7 @@ sub _get_create_table_ddl { my $finfo = shift(@fields); push(@col_lines, "\t$field\t" . $self->get_type_ddl($finfo)); if ($self->FK_ON_CREATE and $finfo->{REFERENCES}) { - my $fk = $finfo->{REFERENCES}; + my $fk = $finfo->{REFERENCES}; my $fk_ddl = $self->get_fk_ddl($table, $field, $fk); push(@fk_lines, $fk_ddl); } @@ -2352,7 +2352,7 @@ sub get_alter_column_ddl { my ($table, $column, $new_def, $set_nulls_to) = @_; my @statements; - my $old_def = $self->get_column_abstract($table, $column); + my $old_def = $self->get_column_abstract($table, $column); my $specific = $self->{db_specific}; # If the types have changed, we have to deal with that. @@ -2711,7 +2711,7 @@ sub delete_column { my ($self, $table, $column) = @_; my $abstract_fields = $self->{abstract_schema}{$table}{FIELDS}; - my $name_position = firstidx { $_ eq $column } @$abstract_fields; + my $name_position = firstidx { $_ eq $column } @$abstract_fields; die "Attempted to delete nonexistent column ${table}.${column}" if $name_position == -1; @@ -2859,7 +2859,7 @@ sub _set_object { sub delete_index { my ($self, $table, $name) = @_; - my $indexes = $self->{abstract_schema}{$table}{INDEXES}; + my $indexes = $self->{abstract_schema}{$table}{INDEXES}; my $name_position = firstidx { $_ eq $name } @$indexes; die "Attempted to delete nonexistent index $name on the $table table" if $name_position == -1; diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 0af73cc8f..4c0d43523 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -178,7 +178,7 @@ sub get_create_database_sql { # MySQL has a simpler ALTER TABLE syntax than ANSI. sub get_alter_column_ddl { my ($self, $table, $column, $new_def, $set_nulls_to) = @_; - my $old_def = $self->get_column($table, $column); + my $old_def = $self->get_column($table, $column); my %new_def_copy = %$new_def; if ($old_def->{PRIMARYKEY} && $new_def->{PRIMARYKEY}) { diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm index 0cf2b6c4b..416e9204b 100644 --- a/Bugzilla/DB/Schema/Oracle.pm +++ b/Bugzilla/DB/Schema/Oracle.pm @@ -228,7 +228,7 @@ sub get_alter_column_ddl { my ($self, $table, $column, $new_def, $set_nulls_to) = @_; my @statements; - my $old_def = $self->get_column_abstract($table, $column); + my $old_def = $self->get_column_abstract($table, $column); my $specific = $self->{db_specific}; # If the types have changed, we have to deal with that. diff --git a/Bugzilla/DB/Schema/Sqlite.pm b/Bugzilla/DB/Schema/Sqlite.pm index 73ee7cfc5..57361d2bb 100644 --- a/Bugzilla/DB/Schema/Sqlite.pm +++ b/Bugzilla/DB/Schema/Sqlite.pm @@ -288,7 +288,7 @@ sub get_rename_column_ddl { sub get_add_fks_sql { my ($self, $table, $column_fks) = @_; my @clauses = $self->_sqlite_table_lines($table); - my @add = $self->_column_fks_to_ddl($table, $column_fks); + my @add = $self->_column_fks_to_ddl($table, $column_fks); push(@clauses, @add); return $self->_sqlite_alter_schema($table, \@clauses); } diff --git a/Bugzilla/DB/Sqlite.pm b/Bugzilla/DB/Sqlite.pm index 68180414c..c180fd0d7 100644 --- a/Bugzilla/DB/Sqlite.pm +++ b/Bugzilla/DB/Sqlite.pm @@ -250,7 +250,7 @@ sub bz_setup_database { # If we created TheSchwartz tables with COLLATE bugzilla (during the # 4.1.x development series) re-create them without it. - my @tables = $self->bz_table_list(); + my @tables = $self->bz_table_list(); my @ts_tables = grep {/^ts_/} @tables; my $drop_ok; foreach my $table (@ts_tables) { diff --git a/Bugzilla/Extension.pm b/Bugzilla/Extension.pm index 746fc4bfd..a5522583e 100644 --- a/Bugzilla/Extension.pm +++ b/Bugzilla/Extension.pm @@ -155,7 +155,7 @@ sub my_inc { # a "require" on Windows, for example.) return if $file !~ /^Bugzilla/; - my $lib_dir = __do_call($class, 'lib_dir'); + my $lib_dir = __do_call($class, 'lib_dir'); my @class_parts = split('::', $class); my ($vol, $dir, $file_name) = File::Spec->splitpath($file); my @dir_parts = File::Spec->splitdir($dir); @@ -190,7 +190,7 @@ sub my_inc { use constant enabled => 1; sub lib_dir { - my $invocant = shift; + my $invocant = shift; my $package_dir = __do_call($invocant, 'package_dir'); # For extensions that are just files in the extensions/ directory, diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 4a364eb3a..97013af51 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -153,7 +153,7 @@ use constant SQL_DEFINITIONS => { {TYPE => 'varchar(64)', NOTNULL => 1, DEFAULT => "'---'"}, FIELD_TYPE_TEXTAREA, {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"}, FIELD_TYPE_DATETIME, {TYPE => 'DATETIME'}, FIELD_TYPE_DATE, {TYPE => 'DATE'}, FIELD_TYPE_BUG_ID, - {TYPE => 'INT3'}, FIELD_TYPE_INTEGER, + {TYPE => 'INT3'}, FIELD_TYPE_INTEGER, {TYPE => 'INT4', NOTNULL => 1, DEFAULT => 0}, }; diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index 360f851aa..bd82a8e3f 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -77,7 +77,7 @@ use constant DEFAULT_MAP => { sub type { my ($class, $field) = @_; - my $field_obj = blessed $field ? $field : Bugzilla::Field->check($field); + my $field_obj = blessed $field ? $field : Bugzilla::Field->check($field); my $field_name = $field_obj->name; if (my $package = $class->CLASS_MAP->{$field_name}) { diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index f0f5856cf..fb43d306b 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -450,7 +450,7 @@ sub create { my ($class, $flag, $timestamp) = @_; $timestamp ||= Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); - my $params = {}; + my $params = {}; my @columns = grep { $_ ne 'id' } $class->_get_db_columns; # Some columns use date formatting so use alias instead @@ -513,7 +513,7 @@ sub update_flags { my ($class, $self, $old_self, $timestamp) = @_; my @old_summaries = $class->snapshot($old_self->flags); - my %old_flags = map { $_->id => $_ } @{$old_self->flags}; + my %old_flags = map { $_->id => $_ } @{$old_self->flags}; foreach my $new_flag (@{$self->flags}) { if (!$new_flag->id) { @@ -549,7 +549,7 @@ sub update_flags { } my @new_summaries = $class->snapshot($self->flags); - my @changes = $class->update_activity(\@old_summaries, \@new_summaries); + my @changes = $class->update_activity(\@old_summaries, \@new_summaries); Bugzilla::Hook::process( 'flag_end_of_update', @@ -628,7 +628,7 @@ sub force_retarget { foreach my $flag (@$flags) { # $bug is undefined when e.g. editing inclusion and exclusion lists. - my $obj = $flag->attachment || $bug || $flag->bug; + my $obj = $flag->attachment || $bug || $flag->bug; my $is_retargetted = $flag->retarget($obj); if ($is_retargetted) { $dbh->do('UPDATE flags SET type_id = ? WHERE id = ?', diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 78123d548..a08ee83b9 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -615,7 +615,7 @@ sub match { my $dbh = Bugzilla->dbh; # Depending on the criteria, we may have to append additional tables. - my $tables = [DB_TABLE]; + my $tables = [DB_TABLE]; my @criteria = sqlify_criteria($criteria, $tables); $tables = join(' ', @$tables); $criteria = join(' AND ', @criteria); @@ -643,7 +643,7 @@ sub count { my $dbh = Bugzilla->dbh; # Depending on the criteria, we may have to append additional tables. - my $tables = [DB_TABLE]; + my $tables = [DB_TABLE]; my @criteria = sqlify_criteria($criteria, $tables); $tables = join(' ', @$tables); $criteria = join(' AND ', @criteria); diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm index 157f8cd32..8715c4cfe 100644 --- a/Bugzilla/Group.pm +++ b/Bugzilla/Group.pm @@ -180,7 +180,7 @@ sub check_members_are_visible { my $user = Bugzilla->user; return if !Bugzilla->params->{'usevisibilitygroups'}; - my $group_id = $self->id; + my $group_id = $self->id; my $is_visible = grep { $_ == $group_id } @{$user->visible_groups_inherited}; if (!$is_visible) { ThrowUserError('group_not_visible', {group => $self}); diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index 3575d30c1..f5c67c692 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -26,7 +26,7 @@ sub process { } sub in { - my $hook_name = shift; + my $hook_name = shift; my $currently_in = Bugzilla->request_cache->{hook_stack}->[-1] || ''; return $hook_name eq $currently_in ? 1 : 0; } diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 248e72852..ff04fe794 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -1843,8 +1843,7 @@ sub _convert_groups_system_from_groupset { my ($admin_gid) = $dbh->selectrow_array("SELECT id FROM groups WHERE name = 'admin'"); if (!$admin_gid) { - $dbh->do( - q{INSERT INTO groups (name, description) + $dbh->do(q{INSERT INTO groups (name, description) VALUES ('admin', 'Administrators')} ); $admin_gid = $dbh->bz_last_key('groups', 'id'); @@ -2255,7 +2254,7 @@ sub _copy_old_charts_into_database { # We also add a new query for "Open", so that migrated products get # the same set as new products (see editproducts.cgi.) my @openedstatuses = ("UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED"); - my $query = join("&", map {"bug_status=$_"} @openedstatuses); + my $query = join("&", map {"bug_status=$_"} @openedstatuses); my $series = new Bugzilla::Series(undef, $product, $all_name, $open_name, undef, 1, $query_prod . $query, 1); @@ -3362,8 +3361,7 @@ sub _initialize_workflow_for_upgrade { sub _make_lang_setting_dynamic { my $dbh = Bugzilla->dbh; - my $count = $dbh->selectrow_array( - q{SELECT 1 FROM setting + my $count = $dbh->selectrow_array(q{SELECT 1 FROM setting WHERE name = 'lang' AND subclass IS NULL} ); @@ -3654,7 +3652,7 @@ sub _set_attachment_comment_type { my $text = $comments{$id}; next if $text !~ /^\Q$string\E(\d+)/; my $attachment_id = $1; - my @lines = split("\n", $text); + my @lines = split("\n", $text); if ($type == CMT_ATTACHMENT_CREATED) { # Now we have to remove the text up until we find a line that's @@ -3723,7 +3721,7 @@ sub _convert_flagtypes_fks_to_set_null { } sub _fix_decimal_types { - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $type = {TYPE => 'decimal(7,2)', NOTNULL => 1, DEFAULT => '0'}; $dbh->bz_alter_column('bugs', 'estimated_time', $type); $dbh->bz_alter_column('bugs', 'remaining_time', $type); @@ -3732,7 +3730,7 @@ sub _fix_decimal_types { sub _fix_series_creator_fk { my $dbh = Bugzilla->dbh; - my $fk = $dbh->bz_fk_info('series', 'creator'); + my $fk = $dbh->bz_fk_info('series', 'creator'); if ($fk and $fk->{DELETE} eq 'SET NULL') { $fk->{DELETE} = 'CASCADE'; $dbh->bz_alter_fk('series', 'creator', $fk); @@ -3889,7 +3887,7 @@ sub _migrate_user_tags { indicate_progress({current => ++$current, total => $total, every => 25}); - my $uri = URI->new("buglist.cgi?$query", 'http'); + my $uri = URI->new("buglist.cgi?$query", 'http'); my $bug_id_list = $uri->query_param_delete('bug_id'); if (!$bug_id_list) { warn "No bug_id param for tag $name from user $user_id: $query"; @@ -3986,7 +3984,7 @@ sub _rename_tags_to_tag { sub _on_delete_set_null_for_audit_log_userid { my $dbh = Bugzilla->dbh; - my $fk = $dbh->bz_fk_info('audit_log', 'user_id'); + my $fk = $dbh->bz_fk_info('audit_log', 'user_id'); if ($fk and !defined $fk->{DELETE}) { $fk->{DELETE} = 'SET NULL'; $dbh->bz_alter_fk('audit_log', 'user_id', $fk); @@ -4027,7 +4025,7 @@ sub _fix_longdescs_primary_key { } sub _fix_longdescs_indexes { - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $bug_id_idx = $dbh->bz_index_info('longdescs', 'longdescs_bug_id_idx'); if ($bug_id_idx && scalar @{$bug_id_idx->{'FIELDS'}} < 2) { $dbh->bz_drop_index('longdescs', 'longdescs_bug_id_idx'); @@ -4126,7 +4124,7 @@ sub _add_password_salt_separator { sub _fix_flagclusions_indexes { my $dbh = Bugzilla->dbh; foreach my $table ('flaginclusions', 'flagexclusions') { - my $index = $table . '_type_id_idx'; + my $index = $table . '_type_id_idx'; my $idx_info = $dbh->bz_index_info($table, $index); if ($idx_info && $idx_info->{'TYPE'} ne 'UNIQUE') { @@ -4187,8 +4185,7 @@ sub _update_alias { return unless $dbh->bz_column_info('bugs', 'alias'); # We need to move the aliases from the bugs table to the bugs_aliases table - $dbh->do( - q{ + $dbh->do(q{ INSERT INTO bugs_aliases (bug_id, alias) SELECT bug_id, alias FROM bugs WHERE alias IS NOT NULL } diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index e309dc942..8d6163223 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -459,7 +459,7 @@ EOT ); my %all_files = (%create_files, %htaccess, %index_html, %files); - my %all_dirs = (%create_dirs, %non_recurse_dirs); + my %all_dirs = (%create_dirs, %non_recurse_dirs); return { create_dirs => \%create_dirs, @@ -683,7 +683,7 @@ sub _create_files { unless (-e $file) { print "Creating $file...\n"; my $info = $files{$file}; - my $fh = new IO::File($file, O_WRONLY | O_CREAT, $info->{perms}) || die $!; + my $fh = new IO::File($file, O_WRONLY | O_CREAT, $info->{perms}) || die $!; print $fh $info->{contents} if $info->{contents}; $fh->close; } diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 4c10263ee..852f7f78e 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -63,14 +63,12 @@ use constant APACHE => qw(apachectl httpd apache2 apache); # If we don't find any of the above binaries in the normal PATH, # these are extra places we look. -use constant APACHE_PATH => [ - qw( +use constant APACHE_PATH => [qw( /usr/sbin /usr/local/sbin /usr/libexec /usr/local/libexec - ) -]; + )]; # The below two constants are subroutines so that they can implement # a hook. Other than that they are actually constants. @@ -475,7 +473,7 @@ sub check_requirements { my ($output) = @_; print "\n", install_string('checking_modules'), "\n" if $output; - my $root = ROOT_USER; + my $root = ROOT_USER; my $missing = _check_missing(REQUIRED_MODULES, $output); print "\n", install_string('checking_dbd'), "\n" if $output; @@ -608,7 +606,7 @@ sub print_module_instructions { if (my @missing = @{$check_results->{apache}}) { print install_string('modules_message_apache'); my $missing_string = join(', ', @missing); - my $size = TABLE_WIDTH - 7; + my $size = TABLE_WIDTH - 7; printf "* \%-${size}s *\n", $missing_string; my $spaces = TABLE_WIDTH - 2; print "*", (' ' x $spaces), "*\n"; diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index 26e58c772..617977241 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -620,7 +620,7 @@ sub set_output_encoding { sub init_console { eval { ON_WINDOWS && require Win32::Console::ANSI; }; $ENV{'ANSI_COLORS_DISABLED'} = 1 if ($@ || !-t *STDOUT); - $SIG{__DIE__} = \&_console_die; + $SIG{__DIE__} = \&_console_die; prevent_windows_dialog_boxes(); set_output_encoding(); } diff --git a/Bugzilla/Job/Mailer.pm b/Bugzilla/Job/Mailer.pm index 4a32f0d05..544d86107 100644 --- a/Bugzilla/Job/Mailer.pm +++ b/Bugzilla/Job/Mailer.pm @@ -34,7 +34,7 @@ sub retry_delay { sub work { my ($class, $job) = @_; - my $msg = $job->arg->{msg}; + my $msg = $job->arg->{msg}; my $success = eval { MessageToMTA($msg, 1); 1; }; if (!$success) { $job->failed($@); diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm index a1803be6e..a9eb0bca4 100644 --- a/Bugzilla/JobQueue/Runner.pm +++ b/Bugzilla/JobQueue/Runner.pm @@ -146,7 +146,7 @@ END else { print "Please edit $dest_file to configure the daemon.\n"; } - } + } } sub gd_can_uninstall { @@ -160,7 +160,7 @@ sub gd_can_uninstall { } system($chkconfig, '--del', $initscript); print "$initscript disabled.", " To stop it, run: $initd/$initscript stop\n"; - } + } } return $self->SUPER::gd_can_install(@_); diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm index 75b5eda59..d8189f5f3 100644 --- a/Bugzilla/Migrate.pm +++ b/Bugzilla/Migrate.pm @@ -690,7 +690,7 @@ sub insert_bugs { my $dbh = Bugzilla->dbh; say get_text('migrate_creating_bugs'); - my $init_statuses = Bugzilla::Status->can_change_to(); + my $init_statuses = Bugzilla::Status->can_change_to(); my %allowed_statuses = map { lc($_->name) => 1 } @$init_statuses; # Bypass the question of whether or not we can file UNCONFIRMED diff --git a/Bugzilla/Migrate/Gnats.pm b/Bugzilla/Migrate/Gnats.pm index 3d51aa60d..a5aa642e1 100644 --- a/Bugzilla/Migrate/Gnats.pm +++ b/Bugzilla/Migrate/Gnats.pm @@ -280,7 +280,7 @@ sub _read_products { my %product = (name => $name, description => $description); my @initial_cc = split(',', $cc); - @initial_cc = @{$self->translate_value('user', \@initial_cc)}; + @initial_cc = @{$self->translate_value('user', \@initial_cc)}; $assigned_to = $self->translate_value('user', $assigned_to); my %component = ( name => $self->config('component_name'), diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index be49df536..815a111f8 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -73,7 +73,7 @@ sub new { } my $condition = 'product_id = ? AND value = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 863eabc00..753ad9047 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -301,7 +301,7 @@ sub check { sub match { my ($invocant, $criteria) = @_; my $class = ref($invocant) || $invocant; - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; return [$class->get_all] if !$criteria; @@ -547,7 +547,7 @@ sub update { Bugzilla->memcached->clear({table => $table, id => $self->id}); Bugzilla->memcached->clear_config() if $self->IS_CONFIG; } - $self->_object_cache_remove({id => $self->id}); + $self->_object_cache_remove({id => $self->id}); $self->_object_cache_remove({name => $self->name}) if $self->name; if (wantarray) { @@ -572,7 +572,7 @@ sub remove_from_db { Bugzilla->memcached->clear({table => $table, id => $self->id}); Bugzilla->memcached->clear_config() if $self->IS_CONFIG; } - $self->_object_cache_remove({id => $self->id}); + $self->_object_cache_remove({id => $self->id}); $self->_object_cache_remove({name => $self->name}) if $self->name; undef $self; } @@ -595,7 +595,7 @@ sub audit_log { # We put the object's name in the "added" or "removed" field. # We do this thing with NAME_FIELD because $self->name returns # the wrong thing for Bugzilla::User. - my $name = $self->{$self->NAME_FIELD}; + my $name = $self->{$self->NAME_FIELD}; my @added_removed = $changes eq AUDIT_CREATE ? (undef, $name) : ($name, undef); $sth->execute($user_id, $class, $self->id, $changes, @added_removed); return; diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 1f80db451..2b39c2819 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -112,7 +112,7 @@ sub create { # of products. sub preload { my ($products, $preload_flagtypes) = @_; - my %prods = map { $_->id => $_ } @$products; + my %prods = map { $_->id => $_ } @$products; my @prod_ids = keys %prods; return unless @prod_ids; @@ -120,7 +120,7 @@ sub preload { require Bugzilla::Component; foreach my $field (qw(component version milestone)) { my $classname = "Bugzilla::" . ucfirst($field); - my $objects = $classname->match({product_id => \@prod_ids}); + my $objects = $classname->match({product_id => \@prod_ids}); # Now populate the products with this set of objects. foreach my $obj (@$objects) { @@ -843,7 +843,7 @@ sub flag_types { # We cache flag types to avoid useless calls to get_clusions(). my $cache = Bugzilla->request_cache->{flag_types_per_product} ||= {}; $self->{flag_types} = {}; - my $prod_id = $self->id; + my $prod_id = $self->id; my $flagtypes = Bugzilla::FlagType::match({product_id => $prod_id}); foreach my $type ('bug', 'attachment') { diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 17f932869..2005fe4db 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -412,7 +412,7 @@ use constant COLUMN_DEPENDS => { # fields it needs a little help. sub COLUMN_JOINS { my $invocant = shift; - my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; + my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; my $joins = { actual_time => { @@ -614,7 +614,7 @@ sub COLUMNS { sub REPORT_COLUMNS { my $invocant = shift; - my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; + my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; my $columns = dclone(blessed($invocant) ? $invocant->COLUMNS : COLUMNS); @@ -658,7 +658,7 @@ use constant GROUP_BY_SKIP => qw( # Note that the params argument may be modified by Bugzilla::Search sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; my $self = {@_}; bless($self, $class); @@ -674,7 +674,7 @@ sub new { # do it, because there's no way to know if we were passed a tied hash # or not. my $params_in = $self->_params; - my %params = map { $_ => $params_in->{$_} } keys %$params_in; + my %params = map { $_ => $params_in->{$_} } keys %$params_in; $self->{params} = \%params; return $self; @@ -707,7 +707,7 @@ sub data { my $sql = $self->_sql; # Do we just want bug IDs to pass to the 2nd query or all the data immediately? - my $func = $all_in_bugs_table ? 'selectall_arrayref' : 'selectcol_arrayref'; + my $func = $all_in_bugs_table ? 'selectall_arrayref' : 'selectcol_arrayref'; my $bug_ids = $dbh->$func($sql); my @extra_data = ({sql => $sql, time => tv_interval($start_time)}); @@ -806,13 +806,13 @@ sub search_description { sub boolean_charts_to_custom_search { my ($self, $cgi_buffer) = @_; my $boolean_charts = $self->_boolean_charts; - my @as_params = $boolean_charts ? $boolean_charts->as_params : (); + my @as_params = $boolean_charts ? $boolean_charts->as_params : (); # We need to start our new ids after the last custom search "f" id. # We can just pick the last id in the array because they are sorted # numerically. my $last_id = ($self->_field_ids)[-1]; - my $count = defined($last_id) ? $last_id + 1 : 0; + my $count = defined($last_id) ? $last_id + 1 : 0; foreach my $param_set (@as_params) { foreach my $name (keys %$param_set) { my $value = $param_set->{$name}; @@ -1329,7 +1329,7 @@ sub _sql_where { # The newline and this particular spacing makes the resulting # SQL a bit more readable for debugging. - my $where = join("\n AND ", $self->_standard_where); + my $where = join("\n AND ", $self->_standard_where); my $clause_sql = $main_clause->as_string; $where .= "\n AND " . $clause_sql if $clause_sql; return $where; @@ -1685,7 +1685,7 @@ sub _boolean_charts { my @param_list = keys %$params; my @all_field_params = grep {/^field-?\d+/} @param_list; - my @chart_ids = map { /^field(-?\d+)/; $1 } @all_field_params; + my @chart_ids = map { /^field(-?\d+)/; $1 } @all_field_params; @chart_ids = sort { $a <=> $b } uniq @chart_ids; my $clause = new Bugzilla::Search::Clause(); @@ -1776,7 +1776,7 @@ sub _field_ids { my @param_list = keys %$params; my @field_params = grep {/^f\d+$/} @param_list; - my @field_ids = map { /(\d+)/; $1 } @field_params; + my @field_ids = map { /(\d+)/; $1 } @field_params; @field_ids = sort { $a <=> $b } @field_ids; return @field_ids; } @@ -2843,7 +2843,7 @@ sub _multiselect_negative { my ($field, $operator) = @$args{qw(field operator)}; $args->{operator} = $self->_reverse_operator($operator); - $args->{term} = $self->_multiselect_term($args, 1); + $args->{term} = $self->_multiselect_term($args, 1); } sub _multiselect_multiple { @@ -2968,7 +2968,7 @@ sub _multiselect_table { } elsif ($field eq 'longdesc') { $args->{_extra_where} = " AND isprivate = 0" if !$self->_user->is_insider; - $args->{full_field} = 'thetext'; + $args->{full_field} = 'thetext'; return "longdescs"; } elsif ($field eq 'longdescs.isprivate') { @@ -3284,7 +3284,7 @@ sub _changedbefore_changedafter { } my $sql_operator = ($operator =~ /before/) ? '<=' : '>='; - my $field_id = $field_object->id; + my $field_id = $field_object->id; # Charts on changed* fields need to be field-specific. Otherwise, # OR chart rows make no sense if they contain multiple fields. @@ -3308,7 +3308,7 @@ sub _changedfrom_changedto { my ($chart_id, $joins, $field, $operator, $quoted) = @$args{qw(chart_id joins field operator quoted)}; - my $column = ($operator =~ /from/) ? 'removed' : 'added'; + my $column = ($operator =~ /from/) ? 'removed' : 'added'; my $field_object = $self->_chart_fields->{$field} || ThrowCodeError("invalid_field_name", {field => $field}); my $field_id = $field_object->id; diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index 10472b0c3..85cb2770f 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -85,12 +85,10 @@ sub FIELD_MAP { # Also, don't allow searching the _accessible stuff via quicksearch # (both because it's unnecessary and because otherwise # "reporter_accessible" and "reporter" both match "rep". - delete @full_map{ - qw(rep_platform bug_status bug_file_loc bug_group + delete @full_map{qw(rep_platform bug_status bug_file_loc bug_group bug_severity bug_status status_whiteboard - cclist_accessible reporter_accessible) - }; + cclist_accessible reporter_accessible)}; Bugzilla::Hook::process('quicksearch_map', {'map' => \%full_map}); @@ -256,7 +254,7 @@ sub quicksearch { } # List of quicksearch-specific CGI parameters to get rid of. - my @params_to_strip = ('quicksearch', 'load', 'run'); + my @params_to_strip = ('quicksearch', 'load', 'run'); my $modified_query_string = $cgi->canonicalise_query(@params_to_strip); if ($cgi->param('load')) { @@ -379,7 +377,7 @@ sub _handle_special_first_chars { return 0 if !defined $qsword || length($qsword) <= 1; my $firstChar = substr($qsword, 0, 1); - my $baseWord = substr($qsword, 1); + my $baseWord = substr($qsword, 1); my @subWords = split(/,/, $baseWord); if ($firstChar eq '#') { @@ -507,7 +505,7 @@ sub _translate_field_name { # Check if we match, as a starting substring, exactly one field. my @field_names = keys %$field_map; - my @matches = grep { $_ =~ /^\Q$field\E/ } @field_names; + my @matches = grep { $_ =~ /^\Q$field\E/ } @field_names; # Eliminate duplicates that are actually the same field # (otherwise "assi" matches both "assignee" and "assigned_to", and diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm index 1611cea56..c988e8997 100644 --- a/Bugzilla/Search/Saved.pm +++ b/Bugzilla/Search/Saved.pm @@ -66,7 +66,7 @@ sub new { ThrowCodeError('bad_arg', {argument => 'name', function => "${class}::new"}); } my $condition = 'userid = ? AND name = ?'; - my $user_id = blessed $user ? $user->id : $user; + my $user_id = blessed $user ? $user->id : $user; detaint_natural($user_id) || ThrowCodeError('param_must_be_numeric', {function => $class . '::_init', param => 'user'}); @@ -206,7 +206,7 @@ sub preload { return unless scalar @$searches; - my @query_ids = map { $_->id } @$searches; + my @query_ids = map { $_->id } @$searches; my $queries_in_footer = $dbh->selectcol_arrayref( 'SELECT namedquery_id FROM namedqueries_link_in_footer @@ -252,7 +252,7 @@ sub link_in_footer { # We only cache link_in_footer for the current Bugzilla->user. return $self->{link_in_footer} if exists $self->{link_in_footer} && !$user; - my $user_id = $user ? $user->id : Bugzilla->user->id; + my $user_id = $user ? $user->id : Bugzilla->user->id; my $link_in_footer = Bugzilla->dbh->selectrow_array( 'SELECT 1 FROM namedqueries_link_in_footer WHERE namedquery_id = ? AND user_id = ?', undef, $self->id, $user_id diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm index 36b6d13ad..ec0a16e34 100644 --- a/Bugzilla/Series.pm +++ b/Bugzilla/Series.pm @@ -28,7 +28,7 @@ use constant ID_FIELD => 'series_id'; sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; # Create a ref to an empty hash and bless it my $self = {}; diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index de421a290..ea319b4f0 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -90,7 +90,7 @@ sub _load_constants { # If no Accept-Language is present it uses the defined default # Templates may also be found in the extensions/ tree sub _include_path { - my $lang = shift || ''; + my $lang = shift || ''; my $cache = Bugzilla->request_cache; $cache->{"template_include_path_$lang"} ||= template_include_path({language => $lang}); @@ -381,7 +381,7 @@ sub multiline_sprintf { my @parts; my @my_sizes = @$sizes; # Copy this so we don't modify the input array. foreach my $string (@$args) { - my $size = shift @my_sizes; + my $size = shift @my_sizes; my @pieces = split("\n", wrap_hard($string, $size)); push(@parts, \@pieces); } @@ -782,7 +782,7 @@ sub create { my ($context, $isinactive) = @_; return sub { return $isinactive ? '<span class="bz_inactive">' . $_[0] . '</span>' : $_[0]; - } + } }, 1 ], @@ -792,7 +792,7 @@ sub create { my ($context, $isclosed) = @_; return sub { return $isclosed ? '<span class="bz_closed">' . $_[0] . '</span>' : $_[0]; - } + } }, 1 ], @@ -802,7 +802,7 @@ sub create { my ($context, $isobsolete) = @_; return sub { return $isobsolete ? '<span class="bz_obsolete">' . $_[0] . '</span>' : $_[0]; - } + } }, 1 ], diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index b797f364e..5426cc8fa 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -153,16 +153,14 @@ sub _update_groups { my $dbh = Bugzilla->dbh; # Update group settings. - my $sth_add_mapping = $dbh->prepare( - qq{INSERT INTO user_group_map ( + my $sth_add_mapping = $dbh->prepare(qq{INSERT INTO user_group_map ( user_id, group_id, isbless, grant_type ) VALUES ( ?, ?, ?, ? ) } ); - my $sth_remove_mapping = $dbh->prepare( - qq{DELETE FROM user_group_map + my $sth_remove_mapping = $dbh->prepare(qq{DELETE FROM user_group_map WHERE user_id = ? AND group_id = ? AND isbless = ? @@ -753,7 +751,7 @@ sub save_last_search { # prevents people from writing over their whole # recent-search list by just refreshing a saved search # (which doesn't have list_id in the header) over and over. - my $list_string = join(',', @$bug_ids); + my $list_string = join(',', @$bug_ids); my $existing_search = Bugzilla::Search::Recent->match( {user_id => $self->id, bug_list => $list_string}); @@ -920,7 +918,7 @@ sub groups { # Add all its members to the FIFO check list # %group_membership contains arrays of group members # for all groups. Accessible by group number. - my $members = $group_membership{$member_id}; + my $members = $group_membership{$member_id}; my @new_to_check = grep(!$checked_groups{$_}, @$members); push(@$groups_to_check, @new_to_check); @@ -1099,7 +1097,7 @@ sub get_products_by_permission { # We will restrict the list to products the user can see. my $selectable_products = $self->get_selectable_products; - my @products = grep { $product_map{$_->id} } @$selectable_products; + my @products = grep { $product_map{$_->id} } @$selectable_products; return \@products; } @@ -1181,7 +1179,7 @@ sub visible_bugs { # Bugzilla::Bug->update automatically removes updated bugs # from the cache to force them to be checked again. my $visible_cache = $self->{_visible_bugs_cache} ||= {}; - my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); + my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); if (@check_ids) { foreach my $id (@check_ids) { @@ -1361,7 +1359,7 @@ sub get_selectable_classifications { my ($self) = @_; if (!defined $self->{selectable_classifications}) { - my $products = $self->get_selectable_products; + my $products = $self->get_selectable_products; my %class_ids = map { $_->classification_id => 1 } @$products; $self->{selectable_classifications} @@ -1540,7 +1538,7 @@ sub check_can_admin_product { sub check_can_admin_flagtype { my ($self, $flagtype_id) = @_; - my $flagtype = Bugzilla::FlagType->check({id => $flagtype_id}); + my $flagtype = Bugzilla::FlagType->check({id => $flagtype_id}); my $can_fully_edit = 1; if (!$self->in_group('editcomponents')) { @@ -1704,13 +1702,11 @@ sub derive_regexp_groups { ); $sth->execute($id, GRANT_REGEXP); - my $group_insert = $dbh->prepare( - q{INSERT INTO user_group_map + my $group_insert = $dbh->prepare(q{INSERT INTO user_group_map (user_id, group_id, isbless, grant_type) VALUES (?, ?, 0, ?)} ); - my $group_delete = $dbh->prepare( - q{DELETE FROM user_group_map + my $group_delete = $dbh->prepare(q{DELETE FROM user_group_map WHERE user_id = ? AND group_id = ? AND isbless = 0 @@ -1756,7 +1752,7 @@ sub product_responsibilities { # We cannot |use| it, because Component.pm already |use|s User.pm. require Bugzilla::Component; - my @comp_ids = map { $_->{'id'} } @$list; + my @comp_ids = map { $_->{'id'} } @$list; my $components = Bugzilla::Component->new_from_list(\@comp_ids); my @prod_list; @@ -1888,8 +1884,8 @@ sub match { } sub match_field { - my $fields = shift; # arguments as a hash - my $data = shift || Bugzilla->input_params; # hash to look up fields in + my $fields = shift; # arguments as a hash + my $data = shift || Bugzilla->input_params; # hash to look up fields in my $behavior = shift || 0; # A constant that tells us how to act my $matches = {}; # the values sent to the template my $matchsuccess = 1; # did the match fail? @@ -2383,7 +2379,7 @@ sub create { # Add the creation date to the profiles_activity table. # $who is the user who created the new user account, i.e. either an # admin or the new user himself. - my $who = Bugzilla->user->id || $user->id; + my $who = Bugzilla->user->id || $user->id; my $creation_date_fieldid = get_field_id('creation_ts'); $dbh->do( @@ -2536,7 +2532,7 @@ sub check_and_send_account_creation_confirmation { # do check() and pull all the user data from the database. sub login_to_id { my ($login, $throw_error) = @_; - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $cache = Bugzilla->request_cache->{user_login_to_id} ||= {}; # We cache lookups because this function showed up as taking up a diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm index 94171a5d9..67f5c5684 100644 --- a/Bugzilla/User/Setting.pm +++ b/Bugzilla/User/Setting.pm @@ -35,7 +35,7 @@ sub new { my $setting_name = shift; my $user_id = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; my $subclass = ''; # Create a ref to an empty hash and bless it @@ -149,8 +149,7 @@ sub add_setting { VALUES (?, ?, 1, ?)}, undef, ($name, $default_value, $subclass) ); - my $sth = $dbh->prepare( - q{INSERT INTO setting_value (name, value, sortindex) + my $sth = $dbh->prepare(q{INSERT INTO setting_value (name, value, sortindex) VALUES (?, ?, ?)} ); @@ -167,7 +166,7 @@ sub get_all_settings { my $dbh = Bugzilla->dbh; my $cache_key = "user_settings.$user_id"; - my $rows = Bugzilla->memcached->get_config({key => $cache_key}); + my $rows = Bugzilla->memcached->get_config({key => $cache_key}); if (!$rows) { $rows = $dbh->selectall_arrayref( q{SELECT name, default_value, is_enabled, setting_value, subclass @@ -232,8 +231,7 @@ sub set_default { my ($setting_name, $default_value, $is_enabled) = @_; my $dbh = Bugzilla->dbh; - my $sth = $dbh->prepare( - q{UPDATE setting + my $sth = $dbh->prepare(q{UPDATE setting SET default_value = ?, is_enabled = ? WHERE name = ?} ); diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 0edd361ce..572479777 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -147,7 +147,7 @@ sub html_light_quote { if (!Bugzilla->feature('html_desc')) { my $safe = join('|', @allow); - my $chr = chr(1); + my $chr = chr(1); # First, escape safe elements. $text =~ s#<($safe)>#$chr$1$chr#go; @@ -168,7 +168,7 @@ sub html_light_quote { push(@allow, qw(a blockquote q span)); # Allowed protocols. - my $safe_protocols = join('|', SAFE_PROTOCOLS); + my $safe_protocols = join('|', SAFE_PROTOCOLS); my $protocol_regexp = qr{(^(?:$safe_protocols):|^[^:]+$)}i; # Deny all elements and attributes unless explicitly authorized. @@ -225,7 +225,7 @@ sub email_filter { if (!Bugzilla->user->id) { my @emails = Email::Address->parse($toencode); if (scalar @emails) { - my @hosts = map { quotemeta($_->host) } @emails; + my @hosts = map { quotemeta($_->host) } @emails; my $hosts_re = join('|', @hosts); $toencode =~ s/\@(?:$hosts_re)//g; return $toencode; @@ -320,7 +320,7 @@ sub correct_urlbase { } sub remote_ip { - my $ip = $ENV{'REMOTE_ADDR'} || '127.0.0.1'; + my $ip = $ENV{'REMOTE_ADDR'} || '127.0.0.1'; my @proxies = split(/[\s,]+/, Bugzilla->params->{'inbound_proxies'}); # If the IP address is one of our trusted proxies, then we look at @@ -778,7 +778,7 @@ sub validate_date { if ($ts) { $date2 = time2str("%Y-%m-%d", $ts); - $date =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; + $date =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; $date2 =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; } my $ret = ($ts && $date eq $date2); diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 6a5930574..dfc5a8e0f 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -76,7 +76,7 @@ sub new { } my $condition = 'product_id = ? AND value = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index a5de3b68e..5852928c1 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -133,7 +133,7 @@ sub fields { foreach my $field (@fields) { my $visibility_field = $field->visibility_field ? $field->visibility_field->name : undef; - my $vis_values = $field->visibility_values; + my $vis_values = $field->visibility_values; my $value_field = $field->value_field ? $field->value_field->name : undef; my (@values, $has_values); @@ -142,7 +142,7 @@ sub fields { or $field->name eq 'keywords') { $has_values = 1; - @values = @{$self->_legal_field_values({field => $field})}; + @values = @{$self->_legal_field_values({field => $field})}; } if (grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)) { @@ -162,7 +162,7 @@ sub fields { ); if ($has_values) { $field_data{value_field} = $self->type('string', $value_field); - $field_data{values} = \@values; + $field_data{values} = \@values; } push(@fields_out, filter $params, \%field_data); } @@ -317,7 +317,7 @@ sub comments { my %comments; if (scalar @$comment_ids) { - my @ids = map { trim($_) } @$comment_ids; + my @ids = map { trim($_) } @$comment_ids; my $comment_data = Bugzilla::Comment->new_from_list(\@ids); # See if we were passed any invalid comment ids. @@ -707,7 +707,7 @@ sub update { my %changes = %{$all_changes{$bug->id}}; foreach my $field (keys %changes) { - my $change = $changes{$field}; + my $change = $changes{$field}; my $api_field = $api_name{$field} || $field; # We normalize undef to an empty string, so that the API diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm index 6d9563d61..f93892068 100644 --- a/Bugzilla/WebService/Bugzilla.pm +++ b/Bugzilla/WebService/Bugzilla.pm @@ -92,7 +92,7 @@ sub extensions { my %retval; foreach my $extension (@{Bugzilla->extensions}) { my $version = $extension->VERSION || 0; - my $name = $extension->NAME; + my $name = $extension->NAME; $retval{$name}->{version} = $self->type('string', $version); } return {extensions => \%retval}; diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 66640beb7..7847029ba 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -364,7 +364,7 @@ sub _argument_type_check { # Now, convert dateTime fields on input. $self->_bz_method_name =~ /^(\S+)\.(\S+)$/; my ($class, $method) = ($1, $2); - my $pkg = $self->{dispatch_path}->{$class}; + my $pkg = $self->{dispatch_path}->{$class}; my @date_fields = @{$pkg->DATE_FIELDS->{$method} || []}; foreach my $field (@date_fields) { if (defined $params->{$field}) { diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm index 8108e1d4f..143b938b6 100644 --- a/Bugzilla/WebService/Server/REST.pm +++ b/Bugzilla/WebService/Server/REST.pm @@ -53,7 +53,7 @@ sub handle { # unless we were looking for OPTIONS if (!$self->_find_resource($self->cgi->path_info)) { if ($self->request->method eq 'OPTIONS' && $self->bz_rest_options) { - my $response = $self->response_header(STATUS_OK, ""); + my $response = $self->response_header(STATUS_OK, ""); my $options_string = join(', ', @{$self->bz_rest_options}); $response->header( 'Allow' => $options_string, @@ -121,7 +121,7 @@ sub response { my $result = {}; if (exists $json_data->{error}) { $result = $json_data->{error}; - $result->{error} = $self->type('boolean', 1); + $result->{error} = $self->type('boolean', 1); $result->{documentation} = REST_DOC; delete $result->{'name'}; # Remove JSONRPCError } @@ -510,7 +510,7 @@ sub _get_content_prefs { # Parse the Accept header, and save type name, score, and position. my @accept_types = split /,/, $self->cgi->http('accept') || ''; - my $order = 0; + my $order = 0; for my $accept_type (@accept_types) { my ($weight) = ($accept_type =~ /q=(\d\.\d+|\d+)/); my ($name) = ($accept_type =~ m#(\S+/[^;]+)#); diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index b0eae8e19..f96f960da 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -379,7 +379,7 @@ sub BEGIN { my $super_method = "SUPER::$method"; return $self->$super_method($value); } - } + } } } |