From: Frédéric Buclin Date: Sat, 29 Sep 2012 11:32:08 +0000 (+0200) Subject: Bug 793893: Tabular reports crash when no format parameter is defined X-Git-Tag: bugzilla-4.4rc1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3568740c745d27de35961fcffd211fef3a396f4b;p=thirdparty%2Fbugzilla.git Bug 793893: Tabular reports crash when no format parameter is defined r=glob a=LpSolit --- diff --git a/report.cgi b/report.cgi index 0241f42b54..2a7f1f1eb4 100755 --- a/report.cgi +++ b/report.cgi @@ -116,10 +116,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; @@ -242,7 +244,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')) { @@ -258,8 +260,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), @@ -268,7 +268,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 = ''; diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 7eb9cf6f07..00ae28f085 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -90,7 +90,6 @@ 'formaturl', 'other_format.name', 'switchbase', - 'format', 'cumulate', ], diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl index 8219ebd89f..8dc4bc5a71 100644 --- a/template/en/default/reports/report.html.tmpl +++ b/template/en/default/reports/report.html.tmpl @@ -123,7 +123,7 @@ Edit this report [% ELSE %] + [%~ format FILTER uri %]&format=report-graph&cumulate=[% cumulate %]"> Edit this report [% END %] @@ -135,7 +135,7 @@ [% ELSE %]
as - +