From: Andrew Dolgov Date: Sat, 10 Dec 2005 13:56:29 +0000 (+0100) Subject: fix empty num_comments handling X-Git-Tag: schema_freeze_for_1.1.1~78 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e31073bd820fb1a9591eac0fdbb3318da6b8027e;p=tt-rss.git fix empty num_comments handling --- diff --git a/functions.php b/functions.php index 799ee6c0..5e789bfa 100644 --- a/functions.php +++ b/functions.php @@ -324,12 +324,12 @@ $entry_link = db_escape_string($entry_link); $entry_comments = db_escape_string($entry_comments); - $num_comments = 0; - - if ($item["slash"]) { + if (defined($item["slash"])) { $num_comments = db_escape_string($item["slash"]["comments"]); } + if (!$num_comments) $num_comments = 0; + if (db_num_rows($result) == 0) { // base post entry does not exist, create it