summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-01-19 01:46:25 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-01-19 01:46:25 +0000
commit09bd156ba212f56cc62de85c53f14127c719522b (patch)
tree226933be541577bc1d347cd1ae02c7a18b155673 /modules/node/node.module
parent86af977ecaebbed31d2897bdf6f3b829b0be924c (diff)
downloadbrdo-09bd156ba212f56cc62de85c53f14127c719522b.tar.gz
brdo-09bd156ba212f56cc62de85c53f14127c719522b.tar.bz2
- Fix tracker pager count query being wrong (it did not return a count but a set, and it counted nodes with more than 1 comment as multiple nodes).
- Clean up various SQL queries: removing literally inserted data (db_escape_string is evil!), fixing single "%" which should be "%%", fixing integers being compared as strings.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index da5134dff..571889a0f 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1864,7 +1864,7 @@ function _node_rewrite_sql($query = '', $nid_alias = 'n', $args = array()) {
function node_rewrite_sql($query, $nid_alias = 'n', $args = array()) {
list($join, $where, $nid_to_select) = _node_rewrite_sql($query, $nid_alias, $args);
- $query = preg_replace('/(SELECT.*)('. $nid_alias .'\.)?nid(.*FROM)/AUs', '\1'. $nid_to_select .'\3', $query);
+ $query = preg_replace('/(SELECT.*)('. $nid_alias .'\.)?(?<!DISTINCT\()(?<!DISTINCT\('. $nid_alias .'\.)nid(.*FROM)/AUsi', '\1'. $nid_to_select .'\3', $query);
$query = preg_replace('|FROM[^[:upper:]/,]+|','\0 '.$join.' ', $query);
if (strpos($query, 'WHERE')) {