PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Mod Submissions (http://www.phpdig.net/forum/forumdisplay.php?f=24)
-   -   Regular Expression Fix (http://www.phpdig.net/forum/showthread.php?t=264)

Charter 12-02-2003 11:58 PM

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



All times are GMT -8. The time now is 05:53 AM.

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