Skip to content
Snippets Groups Projects
Commit a718b692 authored by fox's avatar fox
Browse files

Merge pull request 'Add defaults to api.php variables' (#1) from...

Merge pull request 'Add defaults to api.php variables' (#1) from klempin/tt-rss:fix/undefined-content into master

Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/1
parents 20fb0563 ace19c07
No related branches found
No related tags found
No related merge requests found
...@@ -187,13 +187,13 @@ class API extends Handler { ...@@ -187,13 +187,13 @@ class API extends Handler {
$offset = (int)clean($_REQUEST["skip"]); $offset = (int)clean($_REQUEST["skip"]);
$filter = clean($_REQUEST["filter"] ?? ""); $filter = clean($_REQUEST["filter"] ?? "");
$is_cat = self::param_to_bool(clean($_REQUEST["is_cat"] ?? false)); $is_cat = self::param_to_bool(clean($_REQUEST["is_cat"] ?? false));
$show_excerpt = self::param_to_bool(clean($_REQUEST["show_excerpt"])); $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"]));
/* all_articles, unread, adaptive, marked, updated */ /* all_articles, unread, adaptive, marked, updated */
$view_mode = clean($_REQUEST["view_mode"]); $view_mode = clean($_REQUEST["view_mode"] ?? null);
$include_attachments = self::param_to_bool(clean($_REQUEST["include_attachments"])); $include_attachments = self::param_to_bool(clean($_REQUEST["include_attachments"] ?? false));
$since_id = (int)clean($_REQUEST["since_id"] ?? 0); $since_id = (int)clean($_REQUEST["since_id"] ?? 0);
$include_nested = self::param_to_bool(clean($_REQUEST["include_nested"])); $include_nested = self::param_to_bool(clean($_REQUEST["include_nested"] ?? false));
$sanitize_content = !isset($_REQUEST["sanitize"]) || $sanitize_content = !isset($_REQUEST["sanitize"]) ||
self::param_to_bool($_REQUEST["sanitize"]); self::param_to_bool($_REQUEST["sanitize"]);
$force_update = self::param_to_bool(clean($_REQUEST["force_update"] ?? false)); $force_update = self::param_to_bool(clean($_REQUEST["force_update"] ?? false));
...@@ -204,7 +204,7 @@ class API extends Handler { ...@@ -204,7 +204,7 @@ class API extends Handler {
$_SESSION['hasSandbox'] = $has_sandbox; $_SESSION['hasSandbox'] = $has_sandbox;
list($override_order, $skip_first_id_check) = Feeds::order_to_override_query(clean($_REQUEST["order_by"])); list($override_order, $skip_first_id_check) = Feeds::order_to_override_query(clean($_REQUEST["order_by"] ?? null));
/* do not rely on params below */ /* do not rely on params below */
...@@ -754,6 +754,8 @@ class API extends Handler { ...@@ -754,6 +754,8 @@ class API extends Handler {
} else { } else {
$headline_row["content"] = $line["content"]; $headline_row["content"] = $line["content"];
} }
$headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
} }
// unify label output to ease parsing // unify label output to ease parsing
...@@ -782,8 +784,6 @@ class API extends Handler { ...@@ -782,8 +784,6 @@ class API extends Handler {
}, },
$hook_object); $hook_object);
$headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, $line["content"], $line["site_url"]); list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, $line["content"], $line["site_url"]);
$headline_row["flavor_image"] = $flavor_image; $headline_row["flavor_image"] = $flavor_image;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment