From 1b503eaac98f303b7227e612f763c2e050913cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Wed, 4 Jul 2007 22:24:40 +0000 Subject: [PATCH] #128165 by joshk and webchick: missing db_rewrite_sql() calls in comment queries --- modules/comment/comment.module | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 1e36560c40e..6133ed1643f 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -983,6 +983,7 @@ function comment_render($node, $cid = 0) { $query_args[] = COMMENT_PUBLISHED; } + $query = db_rewrite_sql($query, 'c', 'cid'); $result = db_query($query, $query_args); if ($comment = db_fetch_object($result)) { @@ -1028,6 +1029,8 @@ function comment_render($node, $cid = 0) { $query .= ' ORDER BY SUBSTRING(c.thread, 1, (LENGTH(c.thread) - 1))'; } } + $query = db_rewrite_sql($query, 'c', 'cid'); + $query_count = db_rewrite_sql($query_count, 'c', 'cid'); // Start a form, for use with comment control. $result = pager_query($query, $comments_per_page, 0, $query_count, $query_args); @@ -2208,4 +2211,4 @@ function comment_unpublish_by_keyword_action($comment, $context) { break; } } -} \ No newline at end of file +}