serendipity_fetchComments produced wrong SQL code, if $where and $limit

was set but $order don't
This commit is contained in:
Grischa Brockhaus 2012-01-04 00:12:12 +01:00
parent b14a75b28b
commit d3893904ed

View File

@ -281,7 +281,7 @@ function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = f
WHERE co.type LIKE '" . $type . "' AND co.entry_id > 0 $and
$group
ORDER BY
" . ($where != '' ? '' : 'co.id') . " " . ($order != '' ? $order : '') . "
" . (empty($order) ? 'co.id' : $order) . "
$limit";
$comments = serendipity_db_query($query, false, 'assoc');