From 52a86c5e387689860ae345ee5f1cb3dcf1a974ee Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Feb 2021 08:49:12 +0300 Subject: Revert "api: get flavor image from plugin-processed content" This reverts commit a4604e892c0b8b78c5fa6ff508430cc5864e82d6. --- classes/api.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'classes/api.php') diff --git a/classes/api.php b/classes/api.php index 139b4d662..9299c34ea 100755 --- a/classes/api.php +++ b/classes/api.php @@ -778,23 +778,20 @@ class API extends Handler { $hook_object = ["headline" => &$headline_row]; - if ($show_content) { - PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_RENDER_ARTICLE_API, - function ($result) use (&$headline_row) { - $headline_row = $result; - }, - $hook_object); + PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_RENDER_ARTICLE_API, + function ($result) use (&$headline_row) { + $headline_row = $result; + }, + $hook_object); - list ($flavor_image, $flavor_stream, $flavor_kind) = Article::get_article_image($enclosures, - $headline_row["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_stream"] = $flavor_stream; + $headline_row["flavor_image"] = $flavor_image; + $headline_row["flavor_stream"] = $flavor_stream; - /* optional */ - if ($flavor_kind) - $headline_row["flavor_kind"] = $flavor_kind; - } + /* optional */ + if ($flavor_kind) + $headline_row["flavor_kind"] = $flavor_kind; array_push($headlines, $headline_row); } -- cgit v1.2.3