From: Michael Date: Thu, 12 Nov 2020 16:52:55 +0000 (+0000) Subject: Check for empty body to prevent a fatal error X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ae363b74ad8b295f984ba540fdcb5f0918faa5ea;p=friendica.git Check for empty body to prevent a fatal error --- diff --git a/src/Model/Item.php b/src/Model/Item.php index 834a1c218d..d5f57cff75 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2479,12 +2479,15 @@ class Item */ private static function getLanguage(array $item) { - if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT])) { + if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) || empty($item['body'])) { return ''; } // Convert attachments to links $naked_body = BBCode::removeAttachment($item['body']); + if (empty($naked_body)) { + return ''; + } // Remove links and pictures $naked_body = BBCode::removeLinks($naked_body);