From 7b1fab8b2b75d9762ef28a085e6f934064c778cc Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Thu, 18 Jan 2024 13:41:23 -0500 Subject: [PATCH] Make url shortener detection in body match a slightly longer tld --- inc/instance-config.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index cba250c2..cf41100b 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -560,17 +560,7 @@ $config['filters'][] = array( $config['filters'][] = array( 'condition' => array( - /* - * Old version: - * - * 'body' => '/https?:\/\/\w{2,6}\.[a-z]{2,3}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed - * - has to have http(s):// - * - * - * New version: - * - optional http(s):// domain name (without tld) might have a dash - in it. - */ - 'body' => '/((https)?:\/\/)?[\w-]{2,6}\.[a-z]{2,3}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed + 'body' => '/((https)?:\/\/)?[\w-]{2,6}\.[a-z]{2,4}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed ), 'action' => 'reject', 'message' => 'Url shorteners are not allowed'