summaryrefslogtreecommitdiff
path: root/modules/blog/blog.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-07-25 14:25:42 +0000
committerDries Buytaert <dries@buytaert.net>2004-07-25 14:25:42 +0000
commit702a057683c51f4fdbaaeb8f963ec282caab6d14 (patch)
tree79c689bf5c3c4253c8aa5f8a75b79bbd9dbafefa /modules/blog/blog.module
parentd8d524ffef3c08a44f6563fb76af5fb55a6f397c (diff)
downloadbrdo-702a057683c51f4fdbaaeb8f963ec282caab6d14.tar.gz
brdo-702a057683c51f4fdbaaeb8f963ec282caab6d14.tar.bz2
- Patch #9478 by JonBob: allow printf-style arguments in pager_query.
Currently pager_query() is the black sheep of the database query family, because it does not allow for printf-style arguments to be inserted in the query. This is a problem because it introduces developer confusion when moving from an unpaged query to a paged one, and it encourages substitution of variables directly into the query, which can bypass our check_query() security feature. This patch adds this ability to pager_query(). The change is backwards-compatible, but a couple calls to the function in core have been changed to use the new capability.
Diffstat (limited to 'modules/blog/blog.module')
-rw-r--r--modules/blog/blog.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 90ed4252e..ba9a38600 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -143,7 +143,7 @@ function blog_page_user($uid) {
$title = t("%name's blog", array('%name' => $account->name));
$output = '';
- $result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY sticky DESC, created DESC", variable_get('default_nodes_main', 10));
+ $result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = %d AND status = 1 ORDER BY sticky DESC, created DESC", variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}