Skip to content

Commit

Permalink
Fix like bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssegers committed Aug 11, 2014
1 parent b202d1a commit 67434f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Jenssegers/Mongodb/Query/Builder.php
Expand Up @@ -833,8 +833,8 @@ protected function compileWhereBasic($where)
$regex = str_replace('%', '', $value);

// Convert like to regular expression.
if (starts_with($value, '%')) $regex = '^' . $regex;
if (ends_with($value, '%')) $regex = $regex . '$';
if ( ! starts_with($value, '%')) $regex = '^' . $regex;
if ( ! ends_with($value, '%')) $regex = $regex . '$';

$value = new MongoRegex("/$regex/i");
}
Expand Down

0 comments on commit 67434f2

Please sign in to comment.