MyBB Community Forums

Full Version: Simple search : unable to search some specific string (start by and)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When try to search string like andré or orges if search type is set to standard : receive an error about minimal number of character.

This not happen using Fulltext

Way to reproduce :

  1. Check search setting to set type to "standard"
  2. Go to forum, put andré in quick search
  3. Enter : look at result

mybb Version 1.8.30

The fix can be : in function_search.php
https://github.com/mybb/mybb/blob/368186...#L292-L303

Adding space, if it's still needed (i check without : seems OK too …)
// Search for "and" or "or" (followed by space) and remove if it's at the beginning
 $keywords = trim($keywords);
 if(my_strpos($keywords, "or ") === 0)
 {
 $keywords = substr_replace($keywords, "", 0, 3);
 $keywords = " ".$keywords;
 }

 if(my_strpos($keywords, "and ") === 0)
 {
 $keywords = substr_replace($keywords, "", 0, 4);
 $keywords = " ".$keywords;
 }

https://github.com/mybb/mybb/pull/4532
Yes sorry …
About fixing bug : need to be done in feature branch only ?

I have the fix for this one too : https://community.mybb.com/thread-235369.html
Feature branch Smile