summaryrefslogtreecommitdiffstats
path: root/report.cgi
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-01 23:01:50 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-01 23:01:50 +0200
commit3e4ca16191bcf1d07dbdc6c370491446fbf0f028 (patch)
treecf55830324b81465d0afd4000c8ffba0db41aea5 /report.cgi
parent71f44e682fe7b0f68d3a6a609aa5321c081c3fcc (diff)
downloadbugzilla-3e4ca16191bcf1d07dbdc6c370491446fbf0f028.tar.gz
bugzilla-3e4ca16191bcf1d07dbdc6c370491446fbf0f028.tar.xz
Bug 545766: Figure out what columns can be reported on from the database,
instead of from a static list r=glob, a=mkanat
Diffstat (limited to 'report.cgi')
-rwxr-xr-xreport.cgi21
1 files changed, 4 insertions, 17 deletions
diff --git a/report.cgi b/report.cgi
index 0537235fe..5d2679e1e 100755
--- a/report.cgi
+++ b/report.cgi
@@ -107,30 +107,17 @@ else {
}
# Valid bug fields that can be reported on.
-my @columns = qw(
- assigned_to
- reporter
- qa_contact
- classification
- version
- keywords
- target_milestone
-);
-# Single-select fields (custom or not) are also accepted as valid.
-my @single_selects = Bugzilla->get_fields({ type => FIELD_TYPE_SINGLE_SELECT,
- obsolete => 0 });
-push(@columns, map { $_->name } @single_selects);
-my %valid_columns = map { $_ => 1 } @columns;
+my $valid_columns = Bugzilla::Search::REPORT_COLUMNS;
# Validate the values in the axis fields or throw an error.
!$row_field
- || ($valid_columns{$row_field} && trick_taint($row_field))
+ || ($valid_columns->{$row_field} && trick_taint($row_field))
|| ThrowCodeError("report_axis_invalid", {fld => "x", val => $row_field});
!$col_field
- || ($valid_columns{$col_field} && trick_taint($col_field))
+ || ($valid_columns->{$col_field} && trick_taint($col_field))
|| ThrowCodeError("report_axis_invalid", {fld => "y", val => $col_field});
!$tbl_field
- || ($valid_columns{$tbl_field} && trick_taint($tbl_field))
+ || ($valid_columns->{$tbl_field} && trick_taint($tbl_field))
|| ThrowCodeError("report_axis_invalid", {fld => "z", val => $tbl_field});
my @axis_fields = ($row_field || EMPTY_COLUMN,