Revision 442
Added by Matthias over 18 years ago
| frontend.functions.php | ||
|---|---|---|
| 73 | 73 |
// filter meta-characters |
| 74 | 74 |
$string=preg_quote($string, '/'); |
| 75 | 75 |
if ($string!=$last_string ) {
|
| 76 |
$foo=preg_replace('/('.$string.')(?=[^>;]*(&|<))/iUS', '<span class="highlight">$1</span>',$foo);
|
|
| 76 |
$foo=preg_replace('/((>|;)[^&<]*)('.$string.')(?=[^>;]*(&|<))/iUS', '$1<span class="highlight">$3</span>',$foo);
|
|
| 77 | 77 |
$last_string=$string; |
| 78 | 78 |
} |
| 79 | 79 |
} |
| ... | ... | |
| 184 | 184 |
if (isset($_GET['searchresult']) AND is_numeric($_GET['searchresult']) ) {
|
| 185 | 185 |
if (isset($_GET['sstring']) AND !empty($_GET['sstring']) ){
|
| 186 | 186 |
$arr_string = explode(" ", $_GET['sstring']);
|
| 187 |
if($_GET['searchresult'] == 2) {
|
|
| 188 |
// exact match |
|
| 189 |
$arr_string[0] = strtr($arr_string[0], "_"," "); |
|
| 190 |
$arr_string[1] = strtr($arr_string[1], "_"," "); |
|
| 191 |
} |
|
| 187 | 192 |
ob_start(); //start output buffer |
| 188 | 193 |
require(WB_PATH.'/modules/'.$module.'/view.php'); |
| 189 | 194 |
$foo = ob_get_contents(); // put outputbuffer in $foo |
| ... | ... | |
| 223 | 228 |
$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp");
|
| 224 | 229 |
$page=$query_menu->fetchRow(); |
| 225 | 230 |
if ($links==true AND $temp!=$page_id) |
| 226 |
echo '<a href="'.page_link($page['link']).'">'.htmlentities($page['menu_title']).'</a>';
|
|
| 231 |
echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
|
|
| 227 | 232 |
else |
| 228 |
echo htmlentities($page['menu_title']);
|
|
| 233 |
echo $page['menu_title'];
|
|
| 229 | 234 |
} |
| 230 | 235 |
$counter++; |
| 231 | 236 |
} |
Also available in: Unified diff
Fixed issues with some languages when UTF8 is used.
Removed all htmlentites from the code (revoked changeset [396]) and added new functions instead.
Adapted the search and the highlighting to use the new functions.
With this changes WB can now be used with charset UTF8 for all languages.