From 120044f3daf7c081580e4bc3f912faf394d8f99e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 27 Jan 2024 00:13:14 +0100 Subject: [PATCH] Update src/Protocol/Relay.php Co-authored-by: Hypolite Petovan --- src/Protocol/Relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index b972871aa3..db61e34791 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -120,7 +120,7 @@ class Relay $cleaned = preg_replace('/[@!#]\[url\=.*?\].*?\[\/url\]/ism', '', $body); $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]); return false; }