diff --git a/classes/api.php b/classes/api.php index 802a7ae96..7125e52aa 100755 --- a/classes/api.php +++ b/classes/api.php @@ -174,7 +174,7 @@ class API extends Handler { $unread = getFeedUnread($cat_id, true); if ($unread || !$unread_only) { - array_push($cats, array("id" => (int) $cat_id, + array_push($cats, array("id" => $cat_id, "title" => Feeds::getCategoryTitle($cat_id), "unread" => (int) $unread)); } @@ -243,6 +243,7 @@ class API extends Handler { $field = ""; $set_to = ""; + $additional_fields = ""; switch ($field_raw) { case 0: @@ -842,14 +843,8 @@ class API extends Handler { $_REQUEST['mode'] = 2; $_REQUEST['force_show_empty'] = $include_empty; - if ($pf){ - $data = $pf->makefeedtree(); - $this->wrap(self::STATUS_OK, array("categories" => $data)); - } else { - $this->wrap(self::STATUS_ERR, array("error" => - 'UNABLE_TO_INSTANTIATE_OBJECT')); - } - + $this->wrap(self::STATUS_OK, + array("categories" => $pf->makefeedtree())); } // only works for labels or uncategorized for the time being diff --git a/classes/article.php b/classes/article.php index ff8778096..ff7f11180 100755 --- a/classes/article.php +++ b/classes/article.php @@ -197,7 +197,7 @@ class Article extends Handler_Protected { $sth->execute(array_merge([$score], $ids, [$_SESSION['uid']])); - print json_encode(["id" => $ids, "score" => (int)$score]); + print json_encode(["id" => $ids, "score" => $score]); } function getScore() { @@ -267,7 +267,7 @@ class Article extends Handler_Protected { $this->pdo->commit(); $tags = self::get_article_tags($id); - $tags_str = $this->format_tags_string($tags, $id); + $tags_str = $this->format_tags_string($tags); $tags_str_full = join(", ", $tags); if (!$tags_str_full) $tags_str_full = __("no tags"); @@ -419,7 +419,7 @@ class Article extends Handler_Protected { $retval = $plugin->hook_render_enclosure($entry, $hide_images); - if ($retval) { + if (!empty($retval)) { $rv .= $retval; } else { @@ -584,8 +584,6 @@ class Article extends Handler_Protected { note