]> git.mjollnir.org Git - moodle.git/commitdiff
merfed fix for 6178
authortoyomoyo <toyomoyo>
Tue, 1 Aug 2006 05:12:13 +0000 (05:12 +0000)
committertoyomoyo <toyomoyo>
Tue, 1 Aug 2006 05:12:13 +0000 (05:12 +0000)
lib/setup.php

index 6036e4230410bfc3cc3d448a045098576a460432..3a4c5532f77f2931732e8c9bd1ecb966bb507a90 100644 (file)
@@ -180,16 +180,17 @@ global $HTTPSPAGEREQUIRED;
     raise_memory_limit('64M');    // We should never NEED this much but just in case...
 
 
-/// Try to get unicodedb status from DB
-/// (this is the only one transaction executed before "set names")
-    $utftmp = get_config('', 'unicodedb');
-    if ($utftmp !== false) {  //Only if the record exists
-        $CFG->unicodedb = $utftmp->value;
-    }
-/// If $CFG->unicodedb is not set, calculate it because we need
-/// to know to "set names" properly.
+/// If $CFG->unicodedb is not set, get it from database or calculate it because we need
+/// to know it to "set names" properly.
+/// (this is the only database interaction before "set names")
     if (!isset($CFG->unicodedb)) {
-        $CFG->unicodedb = setup_is_unicodedb();
+        $utftmp = get_config('', 'unicodedb');
+        if ($utftmp !== false) {  //Only if the record exists
+        $CFG->unicodedb = $utftmp->value;
+        } else {
+            $CFG->unicodedb = setup_is_unicodedb();
+            set_config('unicodedb', $CFG->unicodedb);
+        }
     }
 /// Set the client/server and connection to utf8 if necessary
     if ($CFG->unicodedb) {