Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4357cedb
Commit
4357cedb
authored
Mar 06, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 545610: Correctly parse CGI parameters, especially when using mod_perl
r=gerv a=LpSolit
parent
ebe30fe4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
report.cgi
report.cgi
+15
-8
report-table.html.tmpl
template/en/default/reports/report-table.html.tmpl
+7
-6
No files found.
report.cgi
View file @
4357cedb
...
...
@@ -21,7 +21,6 @@ use List::MoreUtils qw(uniq);
my
$cgi
=
Bugzilla
->
cgi
;
my
$template
=
Bugzilla
->
template
;
my
$vars
=
{};
my
$buffer
=
$cgi
->
query_string
();
# Go straight back to query.cgi if we are adding a boolean chart.
if
(
grep
(
/^cmd-/
,
$cgi
->
param
()))
{
...
...
@@ -34,9 +33,6 @@ if (grep(/^cmd-/, $cgi->param())) {
}
Bugzilla
->
login
();
my
$dbh
=
Bugzilla
->
switch_to_shadow_db
();
my
$action
=
$cgi
->
param
(
'action'
)
||
'menu'
;
if
(
$action
eq
"menu"
)
{
...
...
@@ -47,6 +43,9 @@ if ($action eq "menu") {
exit
;
}
# Sanitize the URL, to make URLs shorter.
$cgi
->
clean_search_url
;
my
$col_field
=
$cgi
->
param
(
'x_axis_field'
)
||
''
;
my
$row_field
=
$cgi
->
param
(
'y_axis_field'
)
||
''
;
my
$tbl_field
=
$cgi
->
param
(
'z_axis_field'
)
||
''
;
...
...
@@ -120,6 +119,7 @@ my $query = $search->sql;
$::SIG
{
TERM
}
=
'DEFAULT'
;
$::SIG
{
PIPE
}
=
'DEFAULT'
;
my
$dbh
=
Bugzilla
->
switch_to_shadow_db
();
my
$results
=
$dbh
->
selectall_arrayref
(
$query
);
# We have a hash of hashes for the data itself, and a hash to hold the
...
...
@@ -228,10 +228,10 @@ if ($action eq "wrap") {
# We need to keep track of the defined restrictions on each of the
# axes, because buglistbase, below, throws them away. Without this, we
# get buglistlinks wrong if there is a restriction on an axis field.
$vars
->
{
'col_vals'
}
=
join
(
"&"
,
$buffer
=~
/[&?]($col_field=[^&]+)/g
);
$vars
->
{
'row_vals'
}
=
join
(
"&"
,
$buffer
=~
/[&?]($row_field=[^&]+)/g
);
$vars
->
{
'tbl_vals'
}
=
join
(
"&"
,
$buffer
=~
/[&?]($tbl_field=[^&]+)/g
);
$vars
->
{
'col_vals'
}
=
get_field_restrictions
(
$col_field
);
$vars
->
{
'row_vals'
}
=
get_field_restrictions
(
$row_field
);
$vars
->
{
'tbl_vals'
}
=
get_field_restrictions
(
$tbl_field
);
# We need a number of different variants of the base URL for different
# URLs in the HTML.
$vars
->
{
'buglistbase'
}
=
$cgi
->
canonicalise_query
(
...
...
@@ -331,3 +331,10 @@ sub check_value {
}
return
$value
;
}
sub
get_field_restrictions
{
my
$field
=
shift
;
my
$cgi
=
Bugzilla
->
cgi
;
return
join
(
'&'
,
map
{
"$field=$_"
}
$cgi
->
param
(
$field
));
}
template/en/default/reports/report-table.html.tmpl
View file @
4357cedb
...
...
@@ -19,13 +19,14 @@
[% col_field_disp = field_descs.$col_field || col_field %]
[% row_field_disp = field_descs.$row_field || row_field %]
[% urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html %][% END %]
[% IF tbl == "-total-" %]
[%
urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html
%]
[% "&$tbl_vals" IF tbl_vals %][% END
%]
[% ELSE
%]
[% urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html %]&
[% tbl_field FILTER uri %]=[% tbl FILTER uri %][% END %]
[%
IF tbl_vals
%]
[% urlbase = urlbase _ "&" _ tbl_vals
%]
[% END
%]
[% ELSIF tbl_field %]
[%
urlbase = BLOCK %][% urlbase %]&[%
tbl_field FILTER uri %]=[% tbl FILTER uri %][% END %]
[% END %]
<script type="text/javascript">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment