From 9f08640a731a1d01094b2c0323def767118b211b Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Sun, 17 Dec 2023 12:45:40 +0000 Subject: [PATCH] Disallow url shorteners using filters --- inc/instance-config.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index 99c63901..9f260313 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -558,5 +558,13 @@ $config['filters'][] = array( 'message' => 'Url in the email field is not allowed' ); +$config['filters'][] = array( + 'condition' => array( + 'body' => '/https?:\/\/\w{2,6}\.[a-z]{2,3}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed + ), + 'action' => 'reject', + 'message' => 'Url shorteners are not allowed' +); + $config['global_message'] = '

Matrix

IRC Chat

Mumble

Telegram

Discord

'; $config['debug'] = false;