We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2f4eca commit 4cdb4fbCopy full SHA for 4cdb4fb
src/Jenssegers/Mongodb/Query/Builder.php
@@ -930,7 +930,9 @@ protected function compileWhereBasic($where)
930
if ($operator == 'like')
931
{
932
$operator = '=';
933
- $regex = str_replace('%', '', $value);
+
934
+ // Convert to regular expression.
935
+ $regex = preg_replace('#(^|[^\\\])%#', '$1.*', preg_quote($value));
936
937
// Convert like to regular expression.
938
if ( ! starts_with($value, '%')) $regex = '^' . $regex;
0 commit comments