From ba33c95e97a944a47d9daada717bdd2d8dd3df42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 3 Jul 2022 14:43:45 +0200 Subject: [PATCH] Fixes: "Argument 1 passed to Friendica\Content\Text\BBCode::toPlaintext() must be of the type string, null given, called in /var/www/.../htdocs/mod/display.php on line 305" --- mod/display.php | 2 +- src/Content/Text/BBCode.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/display.php b/mod/display.php index cc594d788..ed2c9ef0f 100644 --- a/mod/display.php +++ b/mod/display.php @@ -302,7 +302,7 @@ function display_content(App $a, $update = false, $update_uid = 0) // Preparing the meta header $description = trim(BBCode::toPlaintext($item['body'])); - $title = trim(BBCode::toPlaintext($item['title'])); + $title = trim(BBCode::toPlaintext($item['title'] ?? '')); $author_name = $item['author-name']; $image = DI::baseUrl()->remove($item['author-avatar']); diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index d82ec39ec..7bb65b698 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -424,7 +424,6 @@ class BBCode * * @param string $body * @param boolean $no_link_desc No link description - * * @return string with replaced body */ public static function removeAttachment(string $body, bool $no_link_desc = false): string @@ -449,7 +448,6 @@ class BBCode * * @param string $text * @param bool $keep_urls Whether to keep URLs in the resulting plaintext - * * @return string */ public static function toPlaintext(string $text, bool $keep_urls = true): string