News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Bug in language error string in search

Started by Gwenwyfar, August 03, 2018, 03:33:29 PM

Previous topic - Next topic

Gwenwyfar

"Search string must be less than %1$d characters long."

Can be replicated here, just search for something over the limit.
"It is impossible to communicate with one that does not wish to communicate"

Illori


d3vcho

I can't replicate it in my forum, not in 2.0.15 nor in 2.1

Screenshot:
https://prnt.sc/keebes
"Greeting Death as an old friend, they departed this life as equals"

Arantor

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...

Gwenwyfar

I can't do it through the advanced form, just the quick search. No maxlength there.
"It is impossible to communicate with one that does not wish to communicate"

Arantor

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.

live627

Found it. The language file gets reloaded on line 63.  I removed it to confirm.


shawnb61

live627 - so should we close this one out then?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

live627

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.

Gwenwyfar

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.
"It is impossible to communicate with one that does not wish to communicate"

Advertisement: