diff options
author | bbaetz%student.usyd.edu.au <> | 2002-06-13 06:18:58 +0000 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-06-13 06:18:58 +0000 |
commit | d02f8a4d2134881785974afb29c7328aafd40fe8 (patch) | |
tree | 38401542db6a990e6922d627980a3506ec249278 /buglist.cgi | |
parent | 901cdb792bd4a554ad68b3f92952953b5bff2059 (diff) | |
download | bugs-d02f8a4d2134881785974afb29c7328aafd40fe8.tar bugs-d02f8a4d2134881785974afb29c7328aafd40fe8.tar.gz bugs-d02f8a4d2134881785974afb29c7328aafd40fe8.tar.bz2 bugs-d02f8a4d2134881785974afb29c7328aafd40fe8.tar.xz bugs-d02f8a4d2134881785974afb29c7328aafd40fe8.zip |
Bug 150882 - SQL error when sorting by bugs.votes with explicit direction
r=gerv x2
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/buglist.cgi b/buglist.cgi index 925f0296f..b649b8f1e 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -1357,10 +1357,9 @@ if ($order) { $query =~ s/\sWHERE\s/ LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product = bugs.product WHERE /; } - # If we are sorting by votes, sort in descending order. - if ($db_order =~ /bugs.votes\s*(asc|desc){0}/i) { - $db_order =~ s/bugs.votes/bugs.votes desc/i; - } + # If we are sorting by votes, sort in descending order if no explicit + # sort order was given + $db_order =~ s/bugs.votes\s*(,|$)/bugs.votes desc$1/i; $query .= " ORDER BY $db_order "; } |