mirror of
https://github.com/friendica/friendica
synced 2025-04-28 07:44:23 +02:00
Posts without text or only with emojis are now always accepted in the language check
This commit is contained in:
parent
5f832cb75a
commit
4dbb7dd3da
3 changed files with 21 additions and 6 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace Friendica\Protocol;
|
||||
|
||||
use Friendica\Content\Smilies;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
|
@ -157,6 +158,11 @@ class Relay
|
|||
*/
|
||||
public static function isWantedLanguage(string $body)
|
||||
{
|
||||
if (empty($body) || Smilies::isEmojiPost($body)) {
|
||||
Logger::debug('Empty body or only emojis', ['body' => $body]);
|
||||
return true;
|
||||
}
|
||||
|
||||
$languages = [];
|
||||
foreach (Item::getLanguageArray($body, 10) as $language => $reliability) {
|
||||
if ($reliability > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue