]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix empty num_comments handling
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 10 Dec 2005 13:56:29 +0000 (14:56 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 10 Dec 2005 13:56:29 +0000 (14:56 +0100)
functions.php

index 799ee6c0a7e1b9185937a92d522855a18521734d..5e789bfae0da9d500112343a8d84a0239080fb12 100644 (file)
                                $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