Skip to content

Commit 67434f2

Browse files
committed
Fix like bug
1 parent b202d1a commit 67434f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,8 @@ protected function compileWhereBasic($where)
833833
$regex = str_replace('%', '', $value);
834834

835835
// Convert like to regular expression.
836-
if (starts_with($value, '%')) $regex = '^' . $regex;
837-
if (ends_with($value, '%')) $regex = $regex . '$';
836+
if ( ! starts_with($value, '%')) $regex = '^' . $regex;
837+
if ( ! ends_with($value, '%')) $regex = $regex . '$';
838838

839839
$value = new MongoRegex("/$regex/i");
840840
}

0 commit comments

Comments
 (0)