From cb66e0c8c133ebb73b36d6cc36c25173ca70a052 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 5dc0e86d..50c87aff 100644
--- a/inc/instance-config.php
+++ b/inc/instance-config.php
@@ -489,7 +489,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);