From 61d338abbd239301bfd5c8cb2a452e8e95c390b6 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 26 Jul 2006 19:30:11 +0000 Subject: [PATCH] Comment::grab_comments() should use $iParentId when != NULL, not just !$iParentId as this prevents the use of $iParentId in cases where the value is 0. Fixes duplicate display of every comment for an application version reported by Nick Law. --- include/comment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/comment.php b/include/comment.php index cd059ea..7e0916e 100644 --- a/include/comment.php +++ b/include/comment.php @@ -269,7 +269,9 @@ class Comment { $iParentId = mysql_real_escape_string($iParentId); $sExtra = ""; - if($iParentId) + + /* NOTE: we must compare against NULL here because $iParentId of 0 is valid */ + if($iParentId != NULL) $sExtra = "AND parentId = '".$iParentId."' "; $sQuery = "SELECT from_unixtime(unix_timestamp(appComments.time), \"%W %M %D %Y, %k:%i\") as time, ".