summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfox <[email protected]>2021-03-02 19:00:08 +0300
committerfox <[email protected]>2021-03-02 19:00:08 +0300
commitc4b78ed0a6cfd3858f42c7330fe2f8a2811c1336 (patch)
tree33d41a283ccc16852fbe8d909665345a2c45c0a4
parent386316aba1b955f50502562e1308e02680ffe997 (diff)
parent57fdf032e95a4af1904827fc1a0234127e040455 (diff)
Merge pull request 'Fix undefined array key warnings when using iOS app' (#12) from sam302psu/tt-rss:undefined-array-keys into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/12
-rwxr-xr-xclasses/api.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/classes/api.php b/classes/api.php
index 991682191..952c97166 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -98,8 +98,8 @@ class API extends Handler {
}
function getUnread() {
- $feed_id = clean($_REQUEST["feed_id"]);
- $is_cat = clean($_REQUEST["is_cat"]);
+ $feed_id = clean($_REQUEST["feed_id"] ?? "");
+ $is_cat = clean($_REQUEST["is_cat"] ?? "");
if ($feed_id) {
$this->_wrap(self::STATUS_OK, array("unread" => getFeedUnread($feed_id, $is_cat)));
@@ -188,15 +188,15 @@ class API extends Handler {
if (is_numeric($feed_id)) $feed_id = (int) $feed_id;
- $limit = (int)clean($_REQUEST["limit"]);
+ $limit = (int)clean($_REQUEST["limit"] ?? 0 );
if (!$limit || $limit >= 200) $limit = 200;
- $offset = (int)clean($_REQUEST["skip"]);
+ $offset = (int)clean($_REQUEST["skip"] ?? 0);
$filter = clean($_REQUEST["filter"] ?? "");
$is_cat = self::_param_to_bool(clean($_REQUEST["is_cat"] ?? false));
$show_excerpt = self::_param_to_bool(clean($_REQUEST["show_excerpt"] ?? false));
- $show_content = self::_param_to_bool(clean($_REQUEST["show_content"]));
+ $show_content = self::_param_to_bool(clean($_REQUEST["show_content"] ?? false));
/* all_articles, unread, adaptive, marked, updated */
$view_mode = clean($_REQUEST["view_mode"] ?? null);
$include_attachments = self::_param_to_bool(clean($_REQUEST["include_attachments"] ?? false));