Skip to content

Commit

Permalink
Only remove trailing whitespace from search string
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnz0r authored Jun 15, 2018
1 parent aa9a23b commit 5f4505e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TermBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static function terms($search){

// Remove every boolean operator (+, -, > <, ( ), ~, *, ", @distance) from the search query
// else we will break the MySQL query.
$search = preg_replace('/[+\-><\(\)~*\"@]+/', '', $search);
$search = rtrim(preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $search));

$terms = collect(preg_split('/[\s,]+/', $search));

Expand Down

0 comments on commit 5f4505e

Please sign in to comment.