Permalink
Browse files

MDL-9147

  • Loading branch information...
1 parent 09bd9bb commit c63af80f8540a12a55d748353494f68862a7dc9f nicolasconnault committed Apr 3, 2007
Showing with 6 additions and 2 deletions.
  1. +6 −2 filter/tidy/filter.php
View
@@ -17,7 +17,7 @@
* @param string text to be filtered
*/
function tidy_filter($courseid, $text) {
-
+ global $CFG;
/// Configuration for tidy. Feel free to tune for your needs, e.g. to allow
/// proprietary markup.
$tidyoptions = array(
@@ -39,7 +39,11 @@ function tidy_filter($courseid, $text) {
/// If enabled: run tidy over the entire string
if (function_exists('tidy_repair_string')){
- $text = tidy_repair_string($text, $tidyoptions);
+ if (empty($CFG->unicodedb)) {
+ $text = tidy_repair_string($text, $tidyoptions);
+ } else {
+ $text = tidy_repair_string($text, $tidyoptions, 'utf8');
+ }
}
return $text;

0 comments on commit c63af80

Please sign in to comment.