Check more fields for the language

This commit is contained in:
Michael
2023-10-08 06:44:37 +00:00
parent 8968c63fcc
commit 0c82974986
4 changed files with 23 additions and 20 deletions

View File

@@ -1212,8 +1212,6 @@ class Item
// Check for hashtags in the body and repair or add hashtag links
$item['body'] = self::setHashtags($item['body']);
$item['language'] = self::getLanguage($item);
$notify_type = Delivery::POST;
// Filling item related side tables
@@ -1262,6 +1260,8 @@ class Item
}
}
$item['language'] = self::getLanguage($item);
$inserted = Post::insert($item['uri-id'], $item);
if ($item['gravity'] == self::GRAVITY_PARENT) {
@@ -1991,7 +1991,7 @@ class Item
return '';
}
$languages = self::getLanguageArray(trim($item['title'] . "\n" . $item['body']), 3, $item['uri-id'], $item['author-id']);
$languages = self::getLanguageArray($item['title'] . ' ' . ($item['content-warning'] ?? '') . ' ' . $item['body'], 3, $item['uri-id'], $item['author-id']);
if (empty($languages)) {
return '';
}