Skip to content

Commit

Permalink
Fix deprecated warning on PHP 8.1 and later (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tarasov authored May 8, 2024
1 parent 3c5473b commit 589111a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 589111a

Please sign in to comment.