From b4ce25e9a449e7a6a78476bf94bca31cbc4259ce Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 7 Aug 2005 22:33:22 +0200 Subject: a first step for search indexing - nothing to see yet darcs-hash:20050807203322-7ad00-6db6733f8fcd861366856635ba3d205fd3bb54da.gz --- inc/utf8.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'inc/utf8.php') diff --git a/inc/utf8.php b/inc/utf8.php index 3eb06865f..176b9f813 100644 --- a/inc/utf8.php +++ b/inc/utf8.php @@ -294,10 +294,11 @@ function utf8_deaccent($string,$case=0){ * stripped chars (they are not included in $UTF8_SPECIAL_CHARS) * * @author Andreas Gohr - * @param string $string The UTF8 string to strip of special chars - * @param string $repl Replace special with this string + * @param string $string The UTF8 string to strip of special chars + * @param string $repl Replace special with this string + * @param string $additional Additional chars to strip (used in regexp char class) */ -function utf8_stripspecials($string,$repl=''){ +function utf8_stripspecials($string,$repl='',$additional=''){ global $UTF8_SPECIAL_CHARS; static $specials = null; @@ -305,7 +306,7 @@ function utf8_stripspecials($string,$repl=''){ $specials = preg_quote(unicode_to_utf8($UTF8_SPECIAL_CHARS), '/'); } - return preg_replace('/[\x00-\x19'.$specials.']/u',$repl,$string); + return preg_replace('/['.$additional.'\x00-\x19'.$specials.']/u',$repl,$string); } /** -- cgit v1.2.3