View Single Post
Old 12-02-2003, 11:58 PM   #1
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Regular Expression Fix

Hi. A regex used in PhpDig versions 1.6.3 and 1.6.4 does not permit certain characters like ß in a search. To fix this do the following.

In search_function.php find:
PHP Code:
if (eregi("[^[:alnum:]^ +^-]+",$query_to_parse)) { $query_to_parse eregi_replace("[^[:alnum:]^ ]+"," ",$query_to_parse); } 
and replace with the following:
PHP Code:
$what_query_chars "[^".$phpdig_words_chars[PHPDIG_ENCODING]." -]+";
if (
eregi($what_query_chars,$query_to_parse)) {
    
$query_to_parse eregi_replace($what_query_chars," ",$query_to_parse);

Also in search_function.php find:
PHP Code:
// init variables 
and right after add the following:
PHP Code:
global $phpdig_words_chars
__________________
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