mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
Fixes from Mits for bug 3101 to fix multi-byte search results
This commit is contained in:
parent
524f9dbe72
commit
5eecb8cb57
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue