MyBB Community Forums
Simple search : unable to search some specific string (start by and) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+---- Thread: Simple search : unable to search some specific string (start by and) (/thread-235334.html)



Simple search : unable to search some specific string (start by and) - BettyIsBoop - 2022-03-30

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/3681869c99a4cd4214f271d72456825e268069c0/inc/functions_search.php#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


RE: Simple search : unable to search some specific string (start by and) - Devilshakerz - 2022-04-07

Related:
https://github.com/mybb/mybb/issues/2349
https://github.com/mybb/mybb/issues/4033 (seems to have been closed via an incorrect fix https://github.com/mybb/mybb/pull/4105)
https://github.com/mybb/mybb/pull/4532


RE: Simple search : unable to search some specific string (start by and) - BettyIsBoop - 2022-04-13

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


RE: Simple search : unable to search some specific string (start by and) - Eldenroot - 2022-04-14

Feature branch Smile