Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Gwenwyfar on August 03, 2018, 03:33:29 PM

Title: Bug in language error string in search
Post by: Gwenwyfar on August 03, 2018, 03:33:29 PM
"Search string must be less than %1$d characters long."

Can be replicated here, just search for something over the limit.
Title: Re: Bug in language error string in search
Post by: Illori on August 03, 2018, 03:37:08 PM
so this is only an SMF 2.0 bug?
Title: Re: Bug in language error string in search
Post by: d3vcho on August 03, 2018, 03:40:52 PM
I can't replicate it in my forum, not in 2.0.15 nor in 2.1

Screenshot:
https://prnt.sc/keebes
Title: Re: Bug in language error string in search
Post by: Arantor on August 03, 2018, 03:44:37 PM
I can reproduce it here but I have to actually modify the form to get the content long enough to actually trip it... not sure where the sweet spot is, but I threw the alphabet several times at it.

Haven't tried on a local install yet. May also be dependent on search method...
Title: Re: Bug in language error string in search
Post by: Gwenwyfar on August 03, 2018, 03:57:43 PM
I can't do it through the advanced form, just the quick search. No maxlength there.
Title: Re: Bug in language error string in search
Post by: Arantor on August 03, 2018, 04:01:42 PM
Heh, I edited out the maxlength on the advanced form and reproduced it. I wonder if you need more than 100 to trigger it?

In any case... it *should* work even in 2.0...

elseif ($smcFunc['strlen']($search_params['search']) > $context['search_string_limit'])
{
$context['search_errors']['string_too_long'] = true;
$txt['error_string_too_long'] = sprintf($txt['error_string_too_long'], $context['search_string_limit']);
}


This should be updating $txt to have the limit put into it... not sure why it isn't.
Title: Re: Bug in language error string in search
Post by: live627 on October 30, 2018, 06:52:01 PM
Found it. The language file gets reloaded on line 63.  I removed it to confirm.
Title: Re: Bug in language error string in search
Post by: live627 on February 23, 2020, 02:50:57 AM
this has been fixed in 2.1 a lifetime ago https://github.com/SimpleMachines/SMF2.1/commit/52490d900eeb7cbc3c3df980ecf595575735c0bd
Title: Re: Bug in language error string in search
Post by: shawnb61 on February 23, 2020, 08:12:59 PM
live627 - so should we close this one out then?
Title: Re: Bug in language error string in search
Post by: live627 on February 24, 2020, 01:28:40 AM
Sure.  I left thus open because I wasn't sure whether we should fix this in 2.0 or not, but it can only be reproduced by going out of our way by hacking.
Title: Re: Bug in language error string in search
Post by: Gwenwyfar on April 27, 2020, 08:33:15 AM
Quote from: live627 on February 24, 2020, 01:28:40 AM
Sure.  I left thus open because I wasn't sure whether we should fix this in 2.0 or not, but it can only be reproduced by going out of our way by hacking.
It's still a bug while using quicksearch, without any hacking.