Advertisement:

Author Topic: Bug in language error string in search  (Read 2845 times)

Offline Gwenwyfar

  • Great Wizard's familiar
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,263
  • Gender: Female
Bug in language error string in search
« 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.
« Last Edit: March 01, 2019, 04:09:23 PM by Gwenwyfar »
Energy follows attention.

There is nothing more precious than being yourself and following your heart.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,957
Re: Bug in language error string in search
« Reply #1 on: August 03, 2018, 03:37:08 PM »
so this is only an SMF 2.0 bug?

Online d3vcho();

  • Sempiterno
  • Lead Localizer
  • SMF Hero
  • *
  • Posts: 3,597
  • Gender: Male
    • frandominguez03 on GitHub
Re: Bug in language error string in search
« Reply #2 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
"These good ideas will tear your brains apart"

d3vcho(void)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,191
    • StoryBB/StoryBB on GitHub
Re: Bug in language error string in search
« Reply #3 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...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Gwenwyfar

  • Great Wizard's familiar
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,263
  • Gender: Female
Re: Bug in language error string in search
« Reply #4 on: August 03, 2018, 03:57:43 PM »
I can't do it through the advanced form, just the quick search. No maxlength there.
Energy follows attention.

There is nothing more precious than being yourself and following your heart.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,191
    • StoryBB/StoryBB on GitHub
Re: Bug in language error string in search
« Reply #5 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...

Code: [Select]
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline live627

  • On Hiatus
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Bug in language error string in search
« Reply #6 on: October 30, 2018, 06:52:01 PM »
Found it. The language file gets reloaded on line 63.  I removed it to confirm.
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein