From cca84aedfdde10c4361505a94ab3eae5d60b56fa Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Feb 2021 10:18:50 +0300 Subject: [PATCH] _format_enclosures: always return entries array --- classes/article.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/classes/article.php b/classes/article.php index 5800af2b7..91fc0c11a 100755 --- a/classes/article.php +++ b/classes/article.php @@ -322,7 +322,6 @@ class Article extends Handler_Protected { $hide_images = false) { $enclosures = self::_get_enclosures($id); - $rv = []; $enclosures_formatted = ""; /*foreach ($enclosures as &$enc) { @@ -348,10 +347,16 @@ class Article extends Handler_Protected { $enclosures_formatted, $enclosures, $id, $always_display_enclosures, $article_content, $hide_images); if (!empty($enclosures_formatted)) { - $rv['formatted'] = $enclosures_formatted; - return $rv; + return [ + 'formatted' => $enclosures_formatted, + 'entries' => [] + ]; } + $rv = [ + 'entries' => [] + ]; + $rv['can_inline'] = isset($_SESSION["uid"]) && empty($_SESSION["bw_limit"]) && !get_pref("STRIP_IMAGES") && @@ -359,8 +364,6 @@ class Article extends Handler_Protected { $rv['inline_text_only'] = $hide_images && $rv['can_inline']; - $rv['entries'] = []; - foreach ($enclosures as $enc) { // this is highly approximate