diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-04-13 18:33:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-04-13 18:33:01 +0000 |
commit | 2efb83ee57120f785caff8cccc0528bf69961c8d (patch) | |
tree | 36c1e7b615427e6f7e4bce47adf0aefb84670633 | |
parent | fd9635e63afc794e686c09a6cbc47e403aab6edd (diff) | |
download | brdo-2efb83ee57120f785caff8cccc0528bf69961c8d.tar.gz brdo-2efb83ee57120f785caff8cccc0528bf69961c8d.tar.bz2 |
- Changed 'empty()' to '!isset()' to fix a caching bug. Patch by Garry.
-rw-r--r-- | modules/comment.module | 4 | ||||
-rw-r--r-- | modules/comment/comment.module | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/comment.module b/modules/comment.module index d30c2a4ae..f3f53577a 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -1319,7 +1319,7 @@ function comment_save_settings($mode, $order, $threshold, $comments_per_page) { function comment_num_all($nid) { static $cache; - if (empty($cache[$nid])) { + if (!isset($cache[$nid])) { $comment = db_fetch_object(db_query("SELECT COUNT(c.nid) AS number FROM node n LEFT JOIN comments c ON n.nid = c.nid WHERE n.nid = '%d' AND c.status = 0 GROUP BY n.nid", $nid)); $cache[$nid] = $comment->number ? $comment->number : 0; } @@ -1329,7 +1329,7 @@ function comment_num_all($nid) { function comment_num_replies($id) { static $cache; - if (empty($cache[$nid])) { + if (!isset($cache[$nid])) { $result = db_query("SELECT COUNT(cid) FROM comments WHERE pid = '%d' AND status = 0", $id); $cache[$nid] = $result ? db_result($result, 0) : 0; } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d30c2a4ae..f3f53577a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1319,7 +1319,7 @@ function comment_save_settings($mode, $order, $threshold, $comments_per_page) { function comment_num_all($nid) { static $cache; - if (empty($cache[$nid])) { + if (!isset($cache[$nid])) { $comment = db_fetch_object(db_query("SELECT COUNT(c.nid) AS number FROM node n LEFT JOIN comments c ON n.nid = c.nid WHERE n.nid = '%d' AND c.status = 0 GROUP BY n.nid", $nid)); $cache[$nid] = $comment->number ? $comment->number : 0; } @@ -1329,7 +1329,7 @@ function comment_num_all($nid) { function comment_num_replies($id) { static $cache; - if (empty($cache[$nid])) { + if (!isset($cache[$nid])) { $result = db_query("SELECT COUNT(cid) FROM comments WHERE pid = '%d' AND status = 0", $id); $cache[$nid] = $result ? db_result($result, 0) : 0; } |