#128165 by joshk and webchick: missing db_rewrite_sql() calls in comment queries

6.x
Gábor Hojtsy 2007-07-04 22:24:40 +00:00
parent 92a32a8676
commit 1b503eaac9
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}
}
}
}