Update src/Protocol/Relay.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
b8f80a8d25
commit
120044f3da
|
@ -120,7 +120,7 @@ class Relay
|
||||||
$cleaned = preg_replace('/[@!#]\[url\=.*?\].*?\[\/url\]/ism', '', $body);
|
$cleaned = preg_replace('/[@!#]\[url\=.*?\].*?\[\/url\]/ism', '', $body);
|
||||||
$content_cleaned = mb_strtolower(BBCode::toPlaintext($cleaned, false));
|
$content_cleaned = mb_strtolower(BBCode::toPlaintext($cleaned, false));
|
||||||
|
|
||||||
if (strlen($content_cleaned) < (strlen($content) - strlen($content_cleaned))) {
|
if (strlen($content_cleaned) < strlen($content) / 2) {
|
||||||
Logger::info('Possible hashtag spam detected - rejected', ['hashtags' => $tags, 'network' => $network, 'url' => $url, 'causer' => $causer, 'body' => $body]);
|
Logger::info('Possible hashtag spam detected - rejected', ['hashtags' => $tags, 'network' => $network, 'url' => $url, 'causer' => $causer, 'body' => $body]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user