mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 21:45:37 +02:00
Merge branch 'MDL-76838-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE
This commit is contained in:
commit
cc7ea9fecd
@ -262,7 +262,7 @@ class xml_writer {
|
||||
protected function xml_safe_utf8($content) {
|
||||
$content = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is', '', $content ?? ''); // clean CTRL chars.
|
||||
$content = preg_replace("/\r\n|\r/", "\n", $content); // Normalize line&return=>line
|
||||
return $content;
|
||||
return fix_utf8($content);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1318,8 +1318,9 @@ function fix_utf8($value) {
|
||||
// Shortcut.
|
||||
return $value;
|
||||
}
|
||||
// No null bytes expected in our data, so let's remove it.
|
||||
$value = str_replace("\0", '', $value);
|
||||
|
||||
// Remove null bytes or invalid Unicode sequences from value.
|
||||
$value = str_replace(["\0", "\xef\xbf\xbe", "\xef\xbf\xbf"], '', $value);
|
||||
|
||||
// Note: this duplicates min_fix_utf8() intentionally.
|
||||
static $buggyiconv = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user