From: Michael Date: Fri, 12 Jan 2024 09:58:16 +0000 (+0000) Subject: Improved handling of empty default languages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=23a83535a0e596edd387060746c2a3c32caa4570;p=friendica.git Improved handling of empty default languages --- 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) {