From: Hypolite Petovan Date: Thu, 23 Aug 2018 00:27:00 +0000 (-0400) Subject: [advancedcontentfilter] Suppress rule evaluation errors X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6670ee769d2b6ef6c8e0b698a4491a15b7c71f27;p=friendica-addons.git [advancedcontentfilter] Suppress rule evaluation errors --- 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; }