From 89b15c8ff86238276de3428c379e46f7c04b6516 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 7 Jul 2009 18:16:51 +0000 Subject: Bug 491467: Make Search.pm and buglist.cgi consistently take column ids for the "fields" and "order" arguments, to prevent problems with using SQL fragments in the order and columnlist. Patch by Max Kanat-Alexander r=wicked, a=mkanat --- template/en/default/list/table.html.tmpl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'template/en/default') diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index ed1f3de3f..10a50b33f 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -87,11 +87,11 @@ [% END %] [% desc = '' %] - [% IF (om = order.match("^bugs\.bug_id( desc)?")) %] - [% desc = ' desc' IF NOT om.0 %] + [% IF (om = order.match("^bug_id( DESC)?")) %] + [% desc = ' DESC' IF NOT om.0 %] [% END %] ID @@ -130,20 +130,13 @@ [% BLOCK columnheader %] - [% IF column.name.match('\s+AS\s+') %] - [%# For aliased columns, use their ID for sorting. %] - [% column.sortalias = id %] - [% ELSE %] - [%# 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 %] + [% IF (om = order.match("$id( DESC)?")) %] + [% desc = ' DESC' IF NOT om.0 %] [% END %] - [% order = order.remove("$column.sortalias( desc)?,?") %] + [% order = order.remove("$id( DESC)?,?") %] @@ -204,6 +197,13 @@ [%- get_status(bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] [% ELSIF column == 'resolution' %] [%- get_resolution(bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] + + [%# Display the login name of the user if their real name is empty. %] + [% ELSIF column.match('_realname$') && bug.$column == '' %] + [% SET login_column = column.remove('_realname$') %] + [% bug.${login_column}.truncate(abbrev.$column.maxlength, + abbrev.$column.ellipsis) FILTER html %] + [% ELSE %] [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] [% END %] -- cgit v1.2.3-24-g4f1b