]> git.mxchange.org Git - friendica.git/commitdiff
Check for empty body to prevent a fatal error
authorMichael <heluecht@pirati.ca>
Thu, 12 Nov 2020 16:52:55 +0000 (16:52 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 12 Nov 2020 16:52:55 +0000 (16:52 +0000)
src/Model/Item.php

index 834a1c218d206437764143961ae5781eda2fe1e2..d5f57cff757994fb3323fd435ae7cfacf8e95e4f 100644 (file)
@@ -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);