From fe825b363470992009ad5447f1b6b6a4c8b58d71 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 20 Sep 2020 17:47:44 +0000 Subject: [PATCH] Fix notice --- src/Content/PageInfo.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index 8a2ee9f9d9..39bd35f73a 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -142,6 +142,10 @@ class PageInfo $text .= " title='" . $data['title'] . "'"; } + if (empty($data['text'])) { + $data['text'] = ''; + } + // Only embedd a picture link when it seems to be a valid picture ("width" is set) if (!empty($data['images']) && !empty($data['images'][0]['width'])) { $preview = str_replace(['[', ']'], ['[', ']'], htmlentities($data['images'][0]['src'], ENT_QUOTES, 'UTF-8', false)); @@ -163,7 +167,7 @@ class PageInfo } } - $text .= ']' . $data['text'] ?? '' . '[/attachment]'; + $text .= ']' . $data['text'] . '[/attachment]'; $hashtags = ''; if (!empty($data['keywords'])) {