PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Bug Tracker

Reply
 
Thread Tools
Old 03-16-2004, 01:27 AM   #1
dsstowe
Green Mole
 
Join Date: Mar 2004
Posts: 1
Unhappy Search Hangs

If you search for a 0 "zero" followed by a space and then anything else. the search hangs and puts a heavy load on server.
dsstowe is offline   Reply With Quote
Old 03-16-2004, 01:40 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Thanks for the post. Moved to bugs. To fix do the following.

In search_function.php find:
PHP Code:
if (SMALL_WORDS_SIZE >= 1) {
while (
ereg(' ([^ ]{1,'.SMALL_WORDS_SIZE.'}) | ([^ ]{1,'.SMALL_WORDS_SIZE.'})$|^([^ ]{1,'.SMALL_WORDS_SIZE.'}) ',$test_short,$regs)) {
     for (
$n=1$n <=3$n++) {
        if (
$regs[$n]) {
            
$ignore .= "\"".stripslashes($regs[$n])."\", ";
            
$test_short trim(str_replace($regs[$n],"",$test_short));
        }
     }
}

and replace with the following:
PHP Code:
if (SMALL_WORDS_SIZE >= 1) {
while (
ereg('( [^ ]{1,'.SMALL_WORDS_SIZE.'} )|( [^ ]{1,'.SMALL_WORDS_SIZE.'})$|^([^ ]{1,'.SMALL_WORDS_SIZE.'} )',$test_short,$regs)) {
     for (
$n=1$n <=3$n++) {
        if ((
$regs[$n]) || ($reg[$n] == 0)) {
            
$ignore .= "\"".trim(stripslashes($regs[$n]))."\", ";
            
$test_short trim(str_replace($regs[$n],"",$test_short));
        }
     }
}
if (
strlen($test_short) <= SMALL_WORDS_SIZE) {
  if (!
eregi("\"".$test_short."\", ",$ignore)) {
    
$ignore .= "\"".stripslashes($test_short)."\", ";
  }
  
$test_short trim(str_replace($test_short,"",$test_short));
}
}
$ignore str_replace("\"\", ","",$ignore); 
This should prevent the loop as well as correct the display message for too short keywords.

Remember to remove any "word" wrapping in the above code.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 03-16-2004, 09:33 AM   #3
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
hello list,

maybe - to prevent other yet unknown loops/bugs -
in first line of search.php:

PHP Code:
set_time_limit(20); 
should help to keep the server live.

Last edited by tomas; 03-16-2004 at 09:35 AM.
tomas is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache hangs when starting to scan a website djuritz Troubleshooting 3 07-14-2006 05:10 AM
spider hangs on indexing pdf (pstotext) sushie External Binaries 7 06-15-2005 05:57 AM
PhpDig hangs... please help bpeovski Troubleshooting 2 08-24-2004 10:20 AM
phpdig spider hangs (a powerpoint file problem) davideyre Troubleshooting 1 03-29-2004 12:35 PM
Indexing hangs, nothing in db WunderStump Troubleshooting 6 02-25-2004 10:36 AM


All times are GMT -8. The time now is 02:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.