PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Troubleshooting (http://www.phpdig.net/forum/forumdisplay.php?f=22)
-   -   Spider problem, Search mb_ereg_replace problem. (Fixed?!) (http://www.phpdig.net/forum/showthread.php?t=2383)

cpeter 02-24-2006 01:56 PM

Spider problem, Search mb_ereg_replace problem. (Fixed?!)
 
Hi,

I would really like to use phpdig to index my pages but it's very complicated to make actually work.

After a fresh install: Suse 9.3, Apache 2.0, PHP 5.1.1 the spider stopped after displaying the wait .. message.
I say that at
admin/robots_functions.php line 650 (
if (!mb_eregi('[0-9a-z[:space:]'.$lotsa_chars.']+',$answer)) { ) the script died.
Once I saved this file as UTF-8 the script worked at that line, but then I had other problem. Headers ware not sent becouse output already started becouse of the UTF-8 chars at the beginning of the file.

This I solved by adding ob_start(); at the begining of config.php.

At this step the spider was able to find the links and find the pages from the site, BUT keywords ware not processed.

Digging further I saw that
libs/phpdig_functions.php, phpdigEpureText function has two lines:
$text = mb_ereg_replace("^([\x00-\x1f]|[\x21-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+","",$text); //off front only
$text = mb_ereg_replace("([\x00-\x1f]|[\x21-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+$","",$text); //off back only

These two lines maked the $text emty for some reason.
When I removed these two lines the keywords ware found and indexed.

Now when I try to search something I get the warnings
Warning: mb_ereg_replace() [function.mb-ereg-replace]: mbregex compile err: premature end of char-class
Damn ... I tought it'll work after so much trouble.

If I disable (comment) the lines in libs/search_functions.php
$query_to_parse = mb_ereg_replace("^([\x00-\x1f]|[\x21-\x2c]|[\x2e-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+","",$query_to_parse); //off front only
$query_to_parse = mb_ereg_replace("([\x00-\x1f]|[\x21-\x2c]|[\x2e-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+$","",$query_to_parse); //off back only
$query_to_parse = trim(mb_ereg_replace(" ([\x00-\x1f]|[\x21-\x2c]|[\x2e-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+"," ",$query_to_parse));
$query_to_parse = trim(mb_ereg_replace("([\x00-\x1f]|[\x21-\x2c]|[\x2e-\x2f]|[\x3a-\x40]|[\x5b-\x60]|[\x7b-\x7f])+ "," ",$query_to_parse));

search will work just fine.

.htaccess has the lines:
PHP_VALUE default_charset UTF-8
PHP_VALUE mbstring.func_overload 0
PHP_VALUE mbstring.encoding_translation On
(phpinfo() confirms this. mbstring is loaded)

Can anybody tell me what I made wrong to have so much problem with the install? I don't beleave that everybody had so many problems installing phpdig becouse then very few would use it. Maybee the author of the script can give a hint how to solve this issue (i'm willing to help him to test on my server).

Any suggestion is greatly apreciated!
Bes tregards,
Peter Csaba
www.webnova.ro


All times are GMT -8. The time now is 11:19 AM.

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