One of my clients for iOS produces the following errors in classes/api.php:
Undefined index: feed_id
1. classes/api.php(101): ttrss_error_handler(8, Undefined index: feed_id, classes/api.php, 101, [[])
2. api/index.php(55): getUnread()
Request URI: /tt-rss/api/
User agent: tiny Reader/2.1.4 (com.pluchon.tiny-Reader; build:2.1.4.2; iOS 14.4.0) Alamofire/4.9.1
Undefined index: is_cat
1. classes/api.php(102): ttrss_error_handler(8, Undefined index: is_cat, classes/api.php, 102, [{"feed_id":null})
2. api/index.php(55): getUnread()
Request URI: /tt-rss/api/
User agent: tiny Reader/2.1.4 (com.pluchon.tiny-Reader; build:2.1.4.2; iOS 14.4.0) Alamofire/4.9.1
Here is a patch to avoid these:
--- api.php.bak 2021-03-01 10:20:14.635099101 +0100
+++ api.php 2021-03-01 10:47:41.529864344 +0100
@@ -98,8 +98,8 @@
}
function getUnread() {
- $feed_id = clean($_REQUEST["feed_id"]);
- $is_cat = clean($_REQUEST["is_cat"]);
+ $feed_id = clean(isset($_REQUEST["feed_id"]) ? $_REQUEST["feed_id"] : null);
+ $is_cat = clean(isset($_REQUEST["is_cat"]) ? $_REQUEST["is_cat"] : null);
if ($feed_id) {
$this->_wrap(self::STATUS_OK, array("unread" => getFeedUnread($feed_id, $is_cat)));