From a30b9e69276f13f59ede6cf6c1e9619ffbf12cb5 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 12 Jan 2024 09:58:16 +0000 Subject: [PATCH] Improved handling of empty default languages --- src/Model/Item.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index f84fcdad84..f3fab4d965 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2122,8 +2122,10 @@ class Item * @param array $default * @return array */ - public static function getLanguageArray(string $body, int $count, int $uri_id = 0, int $author_id = 0, array $default = ['un' => 1]): array + public static function getLanguageArray(string $body, int $count, int $uri_id = 0, int $author_id = 0, array $default = []): array { + $default = $default ?: ['un' => 1]; + $searchtext = BBCode::toSearchText($body, $uri_id); if ((count(explode(' ', $searchtext)) < 10) && (mb_strlen($searchtext) < 30) && $author_id) {