Skip to content

Commit

Permalink
fix like escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
matthi4s committed Jun 29, 2023
1 parent 52e6ff0 commit fed0798
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Driver/Test/TestTableEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ protected function matchesLike(string $likePattern, string $value): bool
{
$likePattern = preg_replace("#(?<!\\\\)%#", ".*", preg_quote($likePattern));
$likePattern = preg_replace("#(?<!\\\\)_#", ".", $likePattern);
$likePattern = str_replace("\\%", "%", $likePattern);
$likePattern = str_replace("\\_", "_", $likePattern);
return preg_match("#" . $likePattern . "#si", $value) === 1;
}

Expand Down

0 comments on commit fed0798

Please sign in to comment.