mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
fixed UTF-8 restore problems caused by utf8_restore
This commit is contained in:
parent
af5be70cf2
commit
fd5ca378e6
@ -470,10 +470,14 @@
|
||||
return $status;
|
||||
}
|
||||
|
||||
//This function is used to add slashes and decode from UTF-8
|
||||
//This function is used to add slashes (and decode from UTF-8 if needed)
|
||||
//It's used intensivelly when restoring modules and saving them in db
|
||||
function backup_todb ($data) {
|
||||
return restore_decode_absolute_links(addslashes(utf8_decode($data)));
|
||||
if (current_charset() != 'UTF-8') {
|
||||
return restore_decode_absolute_links(addslashes(utf8_decode($data)));
|
||||
} else {
|
||||
return restore_decode_absolute_links(addslashes($data));
|
||||
}
|
||||
}
|
||||
|
||||
//This function is used to check that every necessary function to
|
||||
|
@ -2918,9 +2918,13 @@
|
||||
var $finished = false; //Flag to say xml_parse to stop
|
||||
|
||||
//This function is used to get the current contents property value
|
||||
//They are trimed and converted from utf8
|
||||
//They are trimed (and converted from utf8 if needed)
|
||||
function getContents() {
|
||||
return trim(utf8_decode($this->content));
|
||||
if (current_charset() != 'UTF-8') {
|
||||
return trim(utf8_decode($this->content));
|
||||
} else {
|
||||
return trim($this->content);
|
||||
}
|
||||
}
|
||||
|
||||
//This is the startTag handler we use where we are reading the info zone (todo="INFO")
|
||||
|
Loading…
x
Reference in New Issue
Block a user