escape filter words for regexp

This commit is contained in:
Hanno Böck
2020-04-30 10:22:27 +02:00
committed by onli
parent e1291fb54a
commit c479e1c9d2
@@ -1536,7 +1536,7 @@ class serendipity_event_spamblock extends serendipity_event
if (empty($filter_body)) {
continue;
}
if (preg_match('@(' . $filter_body . ')@i', $addData['comment'], $wordmatch)) {
if (preg_match('@(' . preg_quote($filter_body) . ')@i', $addData['comment'], $wordmatch)) {
if ($filter_type == 'moderate') {
$this->log($logfile, $eventData['id'], 'MODERATE', PLUGIN_EVENT_SPAMBLOCK_FILTER_WORDS . ': ' . $wordmatch[1], $addData);
$eventData['moderate_comments'] = true;