From bfff7a8b8dc46c5d8b2d715e9f3d2e12c06e4f89 Mon Sep 17 00:00:00 2001 From: Astrologies Date: Tue, 21 Dec 2021 18:40:27 -0500 Subject: [PATCH] Filter impl --- globals/Dependencies/Moderation/Filter.php | 121 ++++++++++++++++++++ globals/config.php | 1 + globals/functions.php | 123 --------------------- html/register.php | 3 +- html_api/moderation/v2/filtertext.php | 6 +- 5 files changed, 128 insertions(+), 126 deletions(-) create mode 100644 globals/Dependencies/Moderation/Filter.php diff --git a/globals/Dependencies/Moderation/Filter.php b/globals/Dependencies/Moderation/Filter.php new file mode 100644 index 0000000..743bb92 --- /dev/null +++ b/globals/Dependencies/Moderation/Filter.php @@ -0,0 +1,121 @@ +rank != 2) //dont log admins chats diff --git a/html/register.php b/html/register.php index bd091c0..33f4112 100644 --- a/html/register.php +++ b/html/register.php @@ -5,6 +5,7 @@ TODO: This needs a re-do. This is one of the first pages on this project */ +use Alphaland\Moderation\Filter; use Alphaland\Users\Activation; use Alphaland\Users\ReferralProgram; use Alphaland\Web\WebContextManager; @@ -55,7 +56,7 @@ else { $error = ''; } - if(isFiltered($uname)) + if (Filter::IsTextFiltered($uname)) { $error = ''; } diff --git a/html_api/moderation/v2/filtertext.php b/html_api/moderation/v2/filtertext.php index f6ede32..5ca4780 100644 --- a/html_api/moderation/v2/filtertext.php +++ b/html_api/moderation/v2/filtertext.php @@ -1,5 +1,6 @@ false))); } -if (isFiltered($text)) { +if (Filter::IsTextFiltered($text)) +{ logChatMessage($userid, $text, true); if (chatFilterInfractionLimit($userid, 3, 120)) //3 infraction within 2 minutes @@ -19,7 +21,7 @@ if (isFiltered($text)) { die(kickUserIfInGame($userid, "'".$text."' is not appropriate on Alphaland, continued infractions will lead to a ban.")); } - $text = filterText($text); + $text = Filter::FilterText($text); //$text = "[ Content Deleted ]"; }