]> git.mxchange.org Git - friendica-addons.git/commitdiff
[advancedcontentfilter] Suppress rule evaluation errors
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 23 Aug 2018 00:27:00 +0000 (20:27 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 23 Aug 2018 00:27:00 +0000 (20:27 -0400)
advancedcontentfilter/advancedcontentfilter.php

index 55a80a802ebc18f41587606766b4aa9117088e5b..74728c042933c71cc7d734cf2761c5a145829652 100644 (file)
@@ -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;
                        }