aboutsummaryrefslogtreecommitdiffstats
path: root/report.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-09-29 13:29:52 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-09-29 13:29:52 +0200
commit324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f (patch)
treee8cf6b682f9d06238fefbc726a7cd9fed36a5624 /report.cgi
parentdfa185b33b4f9ba434e087f16d949543527c3498 (diff)
downloadbugs-324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f.tar
bugs-324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f.tar.gz
bugs-324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f.tar.bz2
bugs-324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f.tar.xz
bugs-324ea8a4039f901ab6fee0d9c8ee3aa5f492eb4f.zip
Bug 793893: Tabular reports crash when no format parameter is defined
r=glob a=LpSolit
Diffstat (limited to 'report.cgi')
-rwxr-xr-xreport.cgi9
1 files changed, 4 insertions, 5 deletions
diff --git a/report.cgi b/report.cgi
index a5d170825..5c7ec870b 100755
--- a/report.cgi
+++ b/report.cgi
@@ -117,10 +117,12 @@ $width <= 2000 || ThrowUserError("chart_too_large");
|| ThrowCodeError("invalid_dimensions");
$height <= 2000 || ThrowUserError("chart_too_large");
+my $formatparam = $cgi->param('format') || '';
+
# These shenanigans are necessary to make sure that both vertical and
# horizontal 1D tables convert to the correct dimension when you ask to
# display them as some sort of chart.
-if (defined $cgi->param('format') && $cgi->param('format') eq "table") {
+if ($formatparam eq "table") {
if ($col_field && !$row_field) {
# 1D *tables* should be displayed vertically (with a row_field only)
$row_field = $col_field;
@@ -243,7 +245,7 @@ $vars->{'row_names'} = \@row_names;
$vars->{'tbl_names'} = \@tbl_names;
# Below a certain width, we don't see any bars, so there needs to be a minimum.
-if ($cgi->param('format') eq "bar") {
+if ($formatparam eq "bar") {
my $min_width = (scalar(@col_names) || 1) * 20;
if (!$cgi->param('cumulate')) {
@@ -259,8 +261,6 @@ $vars->{'query'} = $query;
$vars->{'saved_report_id'} = $cgi->param('saved_report_id');
$vars->{'debug'} = $cgi->param('debug');
-my $formatparam = $cgi->param('format');
-
if ($action eq "wrap") {
# So which template are we using? If action is "wrap", we will be using
# no format (it gets passed through to be the format of the actual data),
@@ -269,7 +269,6 @@ if ($action eq "wrap") {
# data, or images generated by calling report.cgi again with action as
# "plot".
$formatparam =~ s/[^a-zA-Z\-]//g;
- trick_taint($formatparam);
$vars->{'format'} = $formatparam;
$formatparam = '';