|
12-16-2003, 03:16 AM | #1 |
Green Mole
Join Date: Dec 2003
Location: Groningen, The Netherlands
Posts: 2
|
BUGFIX: PHPDIG stops indexing when a 0 is in the page
Hallo,
I use an older version of PHPDIG (1.4.X) but the same code seems to be in version 1.6.5 The problem occurs when a 0 (zero) stands on its own in the text. PHPDIG doesn't index the words after the zero. The problem lies in the function phpdigindexfile in robot_functions.php. The command strtok is used to cut the text in to separate words. The problem is with the for loop. The loop repeats it's self as long as $token is true. The problem is that if a '0' is in the text $token will become '0'. This will be interpreted as false, so the for loop will stop. See the phpmanual: http://nl3.php.net/manual/en/function.strtok.php (i found the solution in the comments) BUG: for ($token = strtok($text2, $separators); $token; $token = strtok($separators)) { if (!isset($nbre_mots[$token])) $nbre_mots[$token] = 1; else $nbre_mots[$token]++; $total++; } FIX: for ($token = strtok($text2, $separators); $token!==false; $token = strtok($separators)) { if (!isset($nbre_mots[$token])) $nbre_mots[$token] = 1; else $nbre_mots[$token]++; $total++; }
__________________
Jan Alwin de Jong |
12-26-2003, 06:08 PM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Thanks.
__________________
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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Indexing stops after a few pages | Sibona | Troubleshooting | 1 | 05-03-2005 11:27 AM |
Indexing stops after 2 seconds | msberryuk | Troubleshooting | 3 | 01-13-2005 06:28 AM |
PhpDig indexing only whole page | darjanp | Troubleshooting | 1 | 11-15-2004 08:03 AM |
Spider stops indexing (Browser: Done) | rainbow_six | Troubleshooting | 2 | 04-24-2004 09:16 AM |
Indexing always stops with locked site | jamie | Troubleshooting | 3 | 01-06-2004 11:29 AM |