[Pushed] Searching for "orange" will find "angel" in non-fulltext search
Non-Fulltext-Search in MyBB ignores "and" and "or" of the first entered keyword of the search.
If I search for "orange", MyBB will actually search for "ange". I can't search for "andi", because Mybb will complain that my search keyword is only one character long.

The reason is a bug in clean_keywords function:


At these lines, "and" and "or" will be removed from the search string, if they are at the beginning of the first keyword.

I suggest removing the two "if"-statements completely, as they are broken in many ways. Not only will they currently unintentionally remove the first characters of a matching keyword, they also don't protect against "and" and "or" keywords at the first position of a search query (the intention of these lines) if fixed to not cut off longer keywords:

"or test" would become "test" (correct)
"and test" would become "test" (correct)
"or or test" would become "or test" (wrong)
"and and test" would become "and test" (wrong)
"or and test" would become "test" (correct)
"and or test" woud become "or test" (wrong)
and so on ...
I agree
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/2349

Thanks for contributing to MyBB!

The MyBB Group

Forum Jump:

Users browsing this thread: 1 Guest(s)