From 6670ee769d2b6ef6c8e0b698a4491a15b7c71f27 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 22 Aug 2018 20:27:00 -0400 Subject: [PATCH] [advancedcontentfilter] Suppress rule evaluation errors --- advancedcontentfilter/advancedcontentfilter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 55a80a80..74728c04 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -133,7 +133,8 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data) $rule['serialized'] ); - $found = (bool) $expressionLanguage->evaluate($serializedParsedExpression, $vars); + // The error suppression operator is used because of potentially broken user-supplied regular expressions + $found = (bool) @$expressionLanguage->evaluate($serializedParsedExpression, $vars); } catch (Exception $e) { $found = false; } -- 2.39.5