Merge branch 'w18_MDL-32586_m23_glibciconv' of git://github.com/skodak/moodle
This commit is contained in:
+10
-1
@@ -1127,7 +1127,16 @@ function fix_utf8($value) {
|
||||
// shortcut
|
||||
return $value;
|
||||
}
|
||||
return iconv('UTF-8', 'UTF-8//IGNORE', $value);
|
||||
// lower error reporting because glibc throws bogus notices
|
||||
$olderror = error_reporting();
|
||||
if ($olderror & E_NOTICE) {
|
||||
error_reporting($olderror ^ E_NOTICE);
|
||||
}
|
||||
$result = iconv('UTF-8', 'UTF-8//IGNORE', $value);
|
||||
if ($olderror & E_NOTICE) {
|
||||
error_reporting($olderror);
|
||||
}
|
||||
return $result;
|
||||
|
||||
} else if (is_array($value)) {
|
||||
foreach ($value as $k=>$v) {
|
||||
|
||||
Reference in New Issue
Block a user