Commit 67434f23 authored by Jens Segers's avatar Jens Segers

Fix like bug

parent b202d1af
......@@ -833,8 +833,8 @@ class Builder extends QueryBuilder {
$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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment