Revision 490
Added by Matthias over 17 years ago
frontend.functions.php | ||
---|---|---|
76 | 76 |
$string = entities_to_umlauts($search_string, 'UTF-8'); |
77 | 77 |
$string = strtr($string, $string_ul_umlauts); |
78 | 78 |
// do some magic to prevent < > ... from being highlighted |
79 |
$foo = strtr($foo, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
|
|
80 |
$string = strtr($string, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!"));
|
|
79 |
$foo = strtr($foo, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!")); |
|
80 |
$string = strtr($string, array("<"=>"!,,!", ">"=>"!,,,!", "&"=>"!,,,,!", """=>"!,,,,,!", "'"=>"!,,,,,,!")); |
|
81 | 81 |
$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo); |
82 | 82 |
$pos = strpos($foo, '<'); |
83 | 83 |
if ($pos === false) { // "===" means identicaly |
84 | 84 |
$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo); |
85 | 85 |
} |
86 |
$foo = strtr($foo, array("!,,!"=>"<", "!,,,!"=>">", "!,,,,!"=>"&", "!,,,,,!"=>""", "!,,,,,,!"=>"'"));
|
|
86 |
$foo = strtr($foo, array("!,,!"=>"<", "!,,,!"=>">", "!,,,,!"=>"&", "!,,,,,!"=>""", "!,,,,,,!"=>"'")); |
|
87 | 87 |
if(DEFAULT_CHARSET != 'utf-8') { |
88 | 88 |
$foo = umlauts_to_defcharset($foo, 'UTF-8'); |
89 | 89 |
} |
Also available in: Unified diff
Fixed issue with escaped single and double quotes in search result (Thanks to thorn)