Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes MDL-14377 UTF8 misconversions in search results
  • Loading branch information
diml committed Apr 17, 2008
1 parent 504c188 commit ff3af67
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion search/documents/chat_document.php
Expand Up @@ -296,6 +296,6 @@ function chat_check_text_access($path, $itemtype, $this_id, $user, $group_id, $c
function chat_link_post_processing($title){ function chat_link_post_processing($title){
setLocale(LC_TIME, substr(current_language(), 0, 2)); setLocale(LC_TIME, substr(current_language(), 0, 2));
$title = preg_replace('/TT_(.*)_TT/e', "userdate(\\1)", $title); $title = preg_replace('/TT_(.*)_TT/e', "userdate(\\1)", $title);
return $title; return mb_convert_encoding($title, 'UTF-8', 'auto');
} }
?> ?>
9 changes: 9 additions & 0 deletions search/documents/data_document.php
Expand Up @@ -399,4 +399,13 @@ function data_check_text_access($path, $itemtype, $this_id, $user, $group_id, $c


return true; return true;
} }

/**
* post processes the url for cleaner output.
* @param string $title
*/
function data_link_post_processing($title){
return mb_convert_encoding($title, 'UTF-8', 'auto');
}

?> ?>
8 changes: 8 additions & 0 deletions search/documents/forum_document.php
Expand Up @@ -297,4 +297,12 @@ function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id, $
return true; return true;
} }


/**
* post processes the url for cleaner output.
* @param string $title
*/
function forum_link_post_processing($title){
return mb_convert_encoding($title, 'UTF-8', 'auto');
}

?> ?>
2 changes: 1 addition & 1 deletion search/documents/glossary_document.php
Expand Up @@ -251,7 +251,7 @@ function glossary_check_text_access($path, $itemtype, $this_id, $user, $group_id
* @param string $title * @param string $title
*/ */
function glossary_link_post_processing($title){ function glossary_link_post_processing($title){
return mb_convert_encoding($title, 'auto', 'UTF-8'); return mb_convert_encoding($title, 'UTF-8', 'auto');
} }


?> ?>
9 changes: 9 additions & 0 deletions search/documents/lesson_document.php
Expand Up @@ -204,4 +204,13 @@ function lesson_check_text_access($path, $itemtype, $this_id, $user, $group_id,


return true; return true;
} }

/**
* this call back is called when displaying the link for some last post processing
*
*/
function lesson_link_post_processing($title){
return mb_convert_encoding($title, 'UTF-8', 'auto');
}

?> ?>
2 changes: 1 addition & 1 deletion search/documents/resource_document.php
Expand Up @@ -323,6 +323,6 @@ function resource_check_text_access($path, $itemtype, $this_id, $user, $group_id
* @param string $title * @param string $title
*/ */
function resource_link_post_processing($title){ function resource_link_post_processing($title){
return mb_convert_encoding($title, 'auto', 'UTF-8'); return mb_convert_encoding($title, 'UTF-8', 'auto');
} }
?> ?>
8 changes: 8 additions & 0 deletions search/documents/techproject_document.php
Expand Up @@ -290,4 +290,12 @@ function techproject_check_text_access($path, $entry_type, $this_id, $user, $gro
return true; return true;
} //techproject_check_text_access } //techproject_check_text_access


/**
* this call back is called when displaying the link for some last post processing
*
*/
function techproject_link_post_processing($title){
return mb_convert_encoding($title, 'UTF-8', 'auto');
}

?> ?>
9 changes: 9 additions & 0 deletions search/documents/wiki_document.php
Expand Up @@ -262,4 +262,13 @@ function wiki_check_text_access($path, $itemtype, $this_id, $user, $group_id, $c


return true; return true;
} }

/**
* this call back is called when displaying the link for some last post processing
*
*/
function wiki_link_post_processing($title){
return mb_convert_encoding($title, 'UTF-8', 'auto');
}

?> ?>

0 comments on commit ff3af67

Please sign in to comment.