From 4def341b66d91e213848a2e3037f7d391f085abf Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sat, 21 May 2022 00:40:07 +0200 Subject: [PATCH] Protection for #371 --- plugins/demo-account/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/demo-account/index.php b/plugins/demo-account/index.php index b9ad74d1d..10bb92d56 100644 --- a/plugins/demo-account/index.php +++ b/plugins/demo-account/index.php @@ -57,6 +57,14 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin && $this->Config()->Get('plugin', 'email') === $aActionParams['Email']) { $aActionParams['Password'] = $this->Config()->Get('plugin', 'password'); } + else if ('DoFolderCreate' === $sMethodName || 'DoFolderRename' === $sMethodName) { + // Block spam https://github.com/the-djmaze/snappymail/issues/371 + $latin = transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $aActionParams['Folder']); + if (false !== \strpos($latin, 'nigger')) { + \error_log("blocked {$sMethodName} {$aActionParams['Folder']}"); + exit; + } + } } /**