Open weberdigital opened 9 months ago
The blacklist does not work properly, if the words in it contain characters, that have special meanings in a regex (e.g., ^ or $).
The function ValueBlacklistMethod::isStringInString in https://github.com/in2code-de/powermail/blob/12.1.1/Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php#L78 should be changed to something like this:
ValueBlacklistMethod::isStringInString
protected function isStringInString(string $haystack, string $needle): bool { // Change start $needle = preg_quote($needle, '/'); // Change end return preg_match('/(?:\A|[@\s\b_-]|\.)' . $needle . '(?:$|[\s\b_-]|\.)/i', $haystack) === 1; }
Tested your code snippet. Did not change anything (at least in the test setup)
Would you mind to provide a PR with testing instruction? That would be great.
The blacklist does not work properly, if the words in it contain characters, that have special meanings in a regex (e.g., ^ or $).
The function
ValueBlacklistMethod::isStringInString
in https://github.com/in2code-de/powermail/blob/12.1.1/Classes/Domain/Validator/SpamShield/ValueBlacklistMethod.php#L78 should be changed to something like this: