From 939cf591795315a9fe4b85b46685016fc1f9c637 Mon Sep 17 00:00:00 2001 From: discomrade <83621080+discomrade@users.noreply.github.com> Date: Sat, 24 Jul 2021 11:21:38 +0000 Subject: [PATCH] Reduce overreach of fbi.gov filter The initial filter would have ruined words or links containing 'discord', including the non-English words 'discordo' and 'discordar'. Legitimate use of the exact word 'discord', such as sowing discord, will still trigger the filter. --- inc/instance-config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index 91e91f87..f2d320ef 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -492,7 +492,7 @@ $config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]* $config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[$g_alias]+/imu", 'uygh', true); $config['wordfilters'][] = array('/ewish uyghur/i', 'ewish nigger', true); -$config['wordfilters'][] = array('/discord(\.(gg|com))?/iu', 'fbi.gov', true); +$config['wordfilters'][] = array('/(^|
|[ \/])discord(\.(gg|com))?(s?([\W]|
|$))/imu', '$1fbi.gov$4', true); // Prevents replacing false positives in the middle of words or links $config['wordfilters'][] = array('/(^|
|[ (-])iq([) ?!.]||
|$)(score)?/imu', '$1autism score$2', true);