From d3893904ed304b3f618ff1f72e955b41f387ae78 Mon Sep 17 00:00:00 2001 From: Grischa Brockhaus Date: Wed, 4 Jan 2012 00:12:12 +0100 Subject: [PATCH] serendipity_fetchComments produced wrong SQL code, if $where and $limit was set but $order don't --- include/functions_comments.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index 5fb3acf5..3eec2cf4 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -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');