fixed UTF-8 restore problems caused by utf8_restore

This commit is contained in:
skodak 2006-03-03 22:22:07 +00:00
parent af5be70cf2
commit fd5ca378e6
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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")