]> git.mjollnir.org Git - moodle.git/commitdiff
finally now the restore should work and with correct unicode related coding style...
authorskodak <skodak>
Tue, 7 Mar 2006 19:53:56 +0000 (19:53 +0000)
committerskodak <skodak>
Tue, 7 Mar 2006 19:53:56 +0000 (19:53 +0000)
backup/lib.php
backup/restorelib.php

index db4f6f6f2e454d491fef6aeac1a359ed91aa7db3..5acf1108cb54d91d11db30dac4a07af495b8606d 100644 (file)
     //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) {
+        global $CFG;
+
         if (empty($CFG->unicodedb)) {
             return restore_decode_absolute_links(addslashes(utf8_decode($data)));
         } else {
index 7677db0dd8db2552537f558c24f4f14084d7b0ab..22141ed7b6e1d3e0b88fec2146de59c29a0490ab 100644 (file)
         //This function is used to get the current contents property value
         //They are trimed (and converted from utf8 if needed)
         function getContents() {
-            if (current_charset() != 'UTF-8') {
+            global $CFG;
+
+            if (empty($CFG->unicodedb)) {
                 return trim(utf8_decode($this->content));
             } else {
                 return trim($this->content);