From 589111a56a78c36c5add622ab6f75ce502b4ab63 Mon Sep 17 00:00:00 2001 From: Ivan Tarasov <125293303+ivan-tarasov@users.noreply.github.com> Date: Tue, 7 May 2024 23:23:36 -0400 Subject: [PATCH] Fix deprecated warning on PHP 8.1 and later (#20) --- src/Condition.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Condition.php b/src/Condition.php index d243942..021222f 100644 --- a/src/Condition.php +++ b/src/Condition.php @@ -192,7 +192,7 @@ private static function evalOperatorCondition(string $operator, $attributeValue, case '$gte': return $attributeValue >= $conditionValue; case '$regex': - return @preg_match('/'.$conditionValue.'/', $attributeValue) === 1; + return preg_match('/'.$conditionValue.'/', $attributeValue ?? '') === 1; case '$in': if (!is_array($conditionValue)) { return false;