summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Install/Requirements.pm2
-rwxr-xr-xbuglist.cgi6
-rw-r--r--template/en/default/list/table.html.tmpl13
3 files changed, 16 insertions, 5 deletions
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm
index 8fd8fe2c6..05f74e81f 100644
--- a/Bugzilla/Install/Requirements.pm
+++ b/Bugzilla/Install/Requirements.pm
@@ -78,7 +78,7 @@ sub REQUIRED_MODULES {
{
package => 'Template-Toolkit',
module => 'Template',
- version => '2.12'
+ version => '2.15'
},
{
package => 'Email-Send',
diff --git a/buglist.cgi b/buglist.cgi
index 0f98a3811..fa75778b9 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -873,6 +873,7 @@ if ($order) {
# A custom list of columns. Make sure each column is valid.
foreach my $fragment (split(/,/, $order)) {
$fragment = trim($fragment);
+ next unless $fragment;
# Accept an order fragment matching a column name, with
# asc|desc optionally following (to specify the direction)
if (grep($fragment =~ /^\Q$_\E(\s+(asc|desc))?$/, @columnnames, keys(%$columns))) {
@@ -893,11 +894,12 @@ if ($order) {
$order = join(",", @order);
# Now that we have checked that all columns in the order are valid,
# detaint the order string.
- trick_taint($order);
+ trick_taint($order) if $order;
};
}
}
-else {
+
+if (!$order) {
# DEFAULT
$order = "bugs.bug_status, bugs.priority, map_assigned_to.login_name, bugs.bug_id";
}
diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl
index 8941eb515..c2904ceb9 100644
--- a/template/en/default/list/table.html.tmpl
+++ b/template/en/default/list/table.html.tmpl
@@ -88,8 +88,12 @@
[% IF sorted_by_relevance %]
ID
[% ELSE %]
+ [% desc = '' %]
+ [% IF (om = order.match("^bugs\.bug_id( desc)?")) %]
+ [% desc = ' desc' IF NOT om.0 %]
+ [% END %]
<a href="buglist.cgi?
- [% urlquerypart FILTER html %]&amp;order=bugs.bug_id
+ [% urlquerypart FILTER html %]&amp;order=bugs.bug_id[% desc FILTER url_quote %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">ID</a>
[% END %]
@@ -139,8 +143,13 @@
[%# Other columns may sort on their name directly. %]
[% column.sortalias = column.name %]
[% END %]
+ [% desc = '' %]
+ [% IF (om = order.match("$column.sortalias( desc)?")) %]
+ [% desc = ' desc' IF NOT om.0 %]
+ [% END %]
+ [% order = order.remove("$column.sortalias( desc)?,?") %]
<a href="buglist.cgi?[% urlquerypart FILTER html %]&amp;order=
- [% column.sortalias FILTER url_quote %]
+ [% column.sortalias FILTER url_quote %][% desc FILTER url_quote %]
[% ",$order" FILTER url_quote IF order %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">