summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/api.php')
-rwxr-xr-xclasses/api.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/classes/api.php b/classes/api.php
index aa39171bf..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:
@@ -718,8 +719,8 @@ class API extends Handler {
$label_cache = json_decode($label_cache, true);
if ($label_cache) {
- if ($label_cache["no-labels"] == 1)
- $labels = array();
+ if (($label_cache["no-labels"] ?? 0) == 1)
+ $labels = [];
else
$labels = $label_cache;
}
@@ -762,7 +763,7 @@ class API extends Handler {
}
// unify label output to ease parsing
- if ($labels["no-labels"] == 1) $labels = array();
+ if (($labels["no-labels"] ?? 0) == 1) $labels = [];
$headline_row["labels"] = $labels;
@@ -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