Fix the problem and make "foo **" result in the same query as "foo". Without the fix this used to cause an 500 Internal Server Error.
One might argue that "foo **" is not a valid query, to start with. However it can be expected as an input, thus it should not cause a cryptic error anyway. The fix causes to yield the expected results by stripping out the standalone wildcard.
Fix the problem and make "foo **" result in the same query as "foo". Without the fix this used to cause an 500 Internal Server Error.
One might argue that "foo **" is not a valid query, to start with. However it can be expected as an input, thus it should not cause a cryptic error anyway. The fix causes to yield the expected results by stripping out the standalone wildcard.