Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 2025405

Browse files
committed
Optimize DatabasePresenceVerifier
1 parent 22a8bce commit 2025405

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Query/Builder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,6 @@ protected function compileWhereBasic(array $where): array
10751075
$flags = end($e);
10761076
// Extract the regex string between the delimiters
10771077
$regstr = substr($value, 1, -1 - strlen($flags));
1078-
// Unescape forward slashes
1079-
$regstr = stripslashes($regstr);
10801078
$value = new Regex($regstr, $flags);
10811079
}
10821080

tests/Query/BuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,9 @@ function (Builder $builder) {
635635
fn (Builder $builder) => $builder->where('name', 'regex', '#^acme$#si'),
636636
];
637637

638-
yield 'where regex with escaped forward slash' => [
639-
['find' => [['name' => new Regex('ac/me', '')], []]],
640-
fn (Builder $builder) => $builder->where('name', 'regex', '/ac\/me/'),
638+
yield 'where regex with escaped characters' => [
639+
['find' => [['name' => new Regex('a\.c\/m\+e', '')], []]],
640+
fn (Builder $builder) => $builder->where('name', 'regex', '/a\.c\/m\+e/'),
641641
];
642642

643643
yield 'where not regex' => [

0 commit comments

Comments
 (0)