Fixes from Mits for bug 3101 to fix multi-byte search results

This commit is contained in:
moodler 2005-05-03 16:37:01 +00:00
parent 524f9dbe72
commit 5eecb8cb57
2 changed files with 3 additions and 2 deletions

View file

@ -29,7 +29,7 @@ class search_token {
// Need to think about this some more.
function sanitize($userstring){
return htmlentities(addslashes($userstring));
return htmlspecialchars(addslashes($userstring));
}
function getValue(){
return $this->value;

View file

@ -1481,7 +1481,8 @@ function highlight($needle, $haystack, $case=0,
return $haystack;
}
$list_of_words = eregi_replace("[^-a-zA-Z0-9&.']", " ", $needle);
//$list_of_words = eregi_replace("[^-a-zA-Z0-9&.']", " ", $needle); // bug 3101
$list_of_words = $needle;
$list_array = explode(' ', $list_of_words);
for ($i=0; $i<sizeof($list_array); $i++) {
if (strlen($list_array[$i]) == 1) {