fix empty num_comments handling
This commit is contained in:
parent
87a79fa411
commit
e31073bd82
|
@ -324,12 +324,12 @@
|
||||||
$entry_link = db_escape_string($entry_link);
|
$entry_link = db_escape_string($entry_link);
|
||||||
$entry_comments = db_escape_string($entry_comments);
|
$entry_comments = db_escape_string($entry_comments);
|
||||||
|
|
||||||
$num_comments = 0;
|
if (defined($item["slash"])) {
|
||||||
|
|
||||||
if ($item["slash"]) {
|
|
||||||
$num_comments = db_escape_string($item["slash"]["comments"]);
|
$num_comments = db_escape_string($item["slash"]["comments"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$num_comments) $num_comments = 0;
|
||||||
|
|
||||||
if (db_num_rows($result) == 0) {
|
if (db_num_rows($result) == 0) {
|
||||||
|
|
||||||
// base post entry does not exist, create it
|
// base post entry does not exist, create it
|
||||||
|
|
Loading…
Reference in New Issue