Skip to content

Commit a718b69

Browse files
author
fox
committed
Merge pull request 'Add defaults to api.php variables' (torne#1) from klempin/tt-rss:fix/undefined-content into master
Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/1
2 parents 20fb056 + ace19c0 commit a718b69

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

classes/api.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ function getHeadlines() {
187187
$offset = (int)clean($_REQUEST["skip"]);
188188
$filter = clean($_REQUEST["filter"] ?? "");
189189
$is_cat = self::param_to_bool(clean($_REQUEST["is_cat"] ?? false));
190-
$show_excerpt = self::param_to_bool(clean($_REQUEST["show_excerpt"]));
190+
$show_excerpt = self::param_to_bool(clean($_REQUEST["show_excerpt"] ?? false));
191191
$show_content = self::param_to_bool(clean($_REQUEST["show_content"]));
192192
/* all_articles, unread, adaptive, marked, updated */
193-
$view_mode = clean($_REQUEST["view_mode"]);
194-
$include_attachments = self::param_to_bool(clean($_REQUEST["include_attachments"]));
193+
$view_mode = clean($_REQUEST["view_mode"] ?? null);
194+
$include_attachments = self::param_to_bool(clean($_REQUEST["include_attachments"] ?? false));
195195
$since_id = (int)clean($_REQUEST["since_id"] ?? 0);
196-
$include_nested = self::param_to_bool(clean($_REQUEST["include_nested"]));
196+
$include_nested = self::param_to_bool(clean($_REQUEST["include_nested"] ?? false));
197197
$sanitize_content = !isset($_REQUEST["sanitize"]) ||
198198
self::param_to_bool($_REQUEST["sanitize"]);
199199
$force_update = self::param_to_bool(clean($_REQUEST["force_update"] ?? false));
@@ -204,7 +204,7 @@ function getHeadlines() {
204204

205205
$_SESSION['hasSandbox'] = $has_sandbox;
206206

207-
list($override_order, $skip_first_id_check) = Feeds::order_to_override_query(clean($_REQUEST["order_by"]));
207+
list($override_order, $skip_first_id_check) = Feeds::order_to_override_query(clean($_REQUEST["order_by"] ?? null));
208208

209209
/* do not rely on params below */
210210

@@ -754,6 +754,8 @@ function ($result) use (&$line) {
754754
} else {
755755
$headline_row["content"] = $line["content"];
756756
}
757+
758+
$headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
757759
}
758760

759761
// unify label output to ease parsing
@@ -782,8 +784,6 @@ function ($result) use (&$headline_row) {
782784
},
783785
$hook_object);
784786

785-
$headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
786-
787787
list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, $line["content"], $line["site_url"]);
788788

789789
$headline_row["flavor_image"] = $flavor_image;

0 commit comments

Comments
 (0)