Simple search : unable to search some specific string (start by and)
#1
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
Reply
#2
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
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz
Reply
#3
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
Reply
#4
Feature branch Smile
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)