summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-29 10:20:13 +0300
committerAndrew Dolgov <[email protected]>2021-11-29 10:20:13 +0300
commit28fb571dca83f7785695061126aebf49bd58678e (patch)
tree496135561928e6080d06643bd0e7af233eef03cc /classes/api.php
parent831648e3c84ce50645f496e4628ed2a72bdccf10 (diff)
* fix showing headlines for tag-based virtual feeds
* API: allow retrieving headlines for tag-based feeds (bump api level to 18)
Diffstat (limited to 'classes/api.php')
-rwxr-xr-xclasses/api.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/classes/api.php b/classes/api.php
index 1cef9c482..539aa334b 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -1,7 +1,7 @@
<?php
class API extends Handler {
- const API_LEVEL = 17;
+ const API_LEVEL = 18;
const STATUS_OK = 0;
const STATUS_ERR = 1;
@@ -186,11 +186,9 @@ class API extends Handler {
}
function getHeadlines(): bool {
- $feed_id = clean($_REQUEST["feed_id"]);
- if ($feed_id !== "" && is_numeric($feed_id)) {
-
- $feed_id = (int) $feed_id;
+ $feed_id = clean($_REQUEST["feed_id"] ?? "");
+ if (!empty($feed_id)) {
$limit = (int)clean($_REQUEST["limit"] ?? 0 );
if (!$limit || $limit >= 200) $limit = 200;
@@ -632,9 +630,10 @@ class API extends Handler {
}
/**
+ * @param string|int $feed_id
* @return array{0: array<int, array<string, mixed>>, 1: array<string, mixed>} $headlines, $headlines_header
*/
- private static function _api_get_headlines(int $feed_id, int $limit, int $offset,
+ private static function _api_get_headlines(mixed $feed_id, int $limit, int $offset,
string $filter, bool $is_cat, bool $show_excerpt, bool $show_content, ?string $view_mode, string $order,
bool $include_attachments, int $since_id, string $search = "", bool $include_nested = false,
bool $sanitize_content = true, bool $force_update = false, int $excerpt_length = 100, ?int $check_first_id = null,