View Full Version : [fixed] searching "*" problem
Turtullo
Tue 8th Oct '02, 8:22am
i know that searching for all words using * in the search field is not very wise, but a problem came up accidentaly.
some of my users entered * in the search field.
the result was not like this one:
The search term you specified (*) is under the minimum word length (4) and therefore will not be found. Please make this term longer.
but:
Fatal error: Allowed memory size of xxxxxxxxxxx bytes exhausted at zend_hash.c:404 (tried to allocate 35 bytes) in /xxxxxxx/forum/admin/db_mysql.php on line 154
it shows up when only "*" is entered in the search field
what can i do to prevent this error?
Scott MacVicar
Tue 8th Oct '02, 8:36am
why did you remove the amount of memory that was used? It makes debugging the error harder when you remove that.
Are you using the original search.php or have you modified it because the same value doesn't cause any errors on the unhacked forums i visit.
Turtullo
Tue 8th Oct '02, 11:17am
i just removed that info in the post, it is something above 12 mB if that helps You.
my search.php is not hacked.
it must be a server issue I persume,
the script tries to get all words from the db,
and as there is over a million of words to get
server spits out an out of memory message.
but i don't know why the script bypasses lenght checking when * is typed in alone.
when, for example, i type in the search box:
"word1 * word2"
i get a normal error message saying that * is too short, but when i type "*" alone it gets messed up (fatal_error).
Turtullo
Tue 8th Oct '02, 11:24am
ok, it is hacked, I've changed the navbar titles to Polish.
Stadler
Tue 8th Oct '02, 3:49pm
Same here after removing all hacks and after applying them again. So it has noting to do with hacks.
Maximum allowed memory size is ~8MB's
Scott MacVicar
Tue 8th Oct '02, 5:42pm
I'm just about to go look into this now and will hopefully have a solution for you in a short while.
MUG
Tue 8th Oct '02, 5:49pm
The search term you specified (*) is under the minimum word length (3) and therefore will not be found. Please make this term longer.
If this term contains a wildcard, please make this term more specific.
My unhacked 2.2.8 board...
Scott MacVicar
Tue 8th Oct '02, 6:02pm
i see it now
its only on big boards and it happens when its the first word because vBulletin will attempt to search on the other terms in the phrase.
So it basically tries to select every row in the word table which is generally bad, I will see if i can find a solution now.
Scott MacVicar
Tue 8th Oct '02, 6:20pm
after much code reading (damn the search code is complicated)
if (strlen($val)<$minsearchlength) {
if ($firstword) {
$badfirstterm = str_replace("%", "*", $val);
below that add
continue;
seemed to solve the problem, I'll double check it with someone else though.
Turtullo
Tue 8th Oct '02, 6:48pm
Yep, that's it!
good work PPN!
Thanks.
Scott MacVicar
Tue 8th Oct '02, 7:34pm
I dont think there will be any other issues as it simply tells it to move onto the next word in the loop, so dont presume its the final fix.
Turtullo
Tue 8th Oct '02, 7:44pm
i'll stay tuned ;)
Paul
Wed 9th Oct '02, 2:14am
Confirmed on our forums. Using '*' as the only search term resulted in a memory error. Once we applied PPN's suggested fix, the "Search term too small" error was correctly displayed.
Paul
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.