Relax url shortener regex (http(s):// part is optional)

This commit is contained in:
towards-a-new-leftypol 2024-01-11 12:52:18 -05:00
parent c1d12ffa92
commit 0a30b856ce
1 changed files with 11 additions and 1 deletions

View File

@ -560,7 +560,17 @@ $config['filters'][] = array(
$config['filters'][] = array(
'condition' => array(
'body' => '/https?:\/\/\w{2,6}\.[a-z]{2,3}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed
/*
* 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
),
'action' => 'reject',
'message' => 'Url shorteners are not allowed'