Revision 476
Added by Matthias over 17 years ago
frontend.functions.php | ||
---|---|---|
71 | 71 |
require_once(WB_PATH.'/framework/functions.php'); |
72 | 72 |
require(WB_PATH.'/search/search_convert.php'); |
73 | 73 |
$foo = entities_to_umlauts($foo, 'UTF-8'); |
74 |
foreach($arr_string as $string) { |
|
75 |
$string = strtr($string, $string_htmlspecialchars_decode); |
|
76 |
$string = entities_to_umlauts($string, 'UTF-8'); |
|
77 |
$string = preg_quote($string, '/'); |
|
78 |
$string = strtr($string, $string_ul_umlauts); |
|
79 |
$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo); |
|
80 |
$pos = strpos($foo, '<'); |
|
81 |
if ($pos === false) { // "===" means identicaly |
|
82 |
$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo); |
|
83 |
} |
|
74 |
array_walk($arr_string, create_function('&$v,$k','$v = preg_quote($v, \'/\');')); |
|
75 |
$search_string = implode("|", $arr_string); |
|
76 |
$string = entities_to_umlauts($search_string, 'UTF-8'); |
|
77 |
$string = strtr($string, $string_ul_umlauts); |
|
78 |
$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo); |
|
79 |
$pos = strpos($foo, '<'); |
|
80 |
if ($pos === false) { // "===" means identicaly |
|
81 |
$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo); |
|
84 | 82 |
} |
85 | 83 |
$foo = umlauts_to_entities($foo, 'UTF-8', 0); |
86 | 84 |
return $foo; |
Also available in: Unified diff
Added function wich replaces mbstring cause this seems not to work properly on some php4 versions (Thanks to thorn)