From 7a680dd9b7d14c353a45ccdeb046ee1d806b393a Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 8 Jan 2024 06:48:49 +0000 Subject: [PATCH] Take language from quoted post --- src/Model/Item.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Model/Item.php b/src/Model/Item.php index f9ccc473fe..d49d6e2390 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2075,6 +2075,13 @@ class Item $content = trim(($item['title'] ?? '') . ' ' . ($item['content-warning'] ?? '') . ' ' . ($item['body'] ?? '')); + if (empty($content) && !empty($item['quote-uri-id'])) { + $quoted = Post::selectFirstPost(['language'], ['uri-id' => $item['quote-uri-id']]); + if (!empty($quoted['language'])) { + return $quoted['language']; + } + } + $languages = self::getLanguageArray($content, 3, $item['uri-id'], $item['author-id'], $transmitted); if (!empty($transmitted)) {