]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fixup config errors
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 12 Mar 2009 03:43:03 +0000 (23:43 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 12 Mar 2009 03:43:03 +0000 (23:43 -0400)
index.php

index dae1ae75145e127a906b64a488f5248ebae05ae8..e83d08c13e9024fe5482aa7b4540b178754dbad4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -63,7 +63,7 @@ function handleError($error)
 
 function main()
 {
-    global $user, $action;
+    global $user, $action, $config;
 
     if (!_have_config()) {
         $msg = sprintf(_("No configuration file found. Try running ".
@@ -131,11 +131,11 @@ function main()
         if (common_config('db', 'mirror') && $action_obj->isReadOnly()) {
             if (is_array(common_config('db', 'mirror'))) {
                 // "load balancing", ha ha
-                $k = array_rand($config['db']['mirror']);
-
-                $mirror = $config['db']['mirror'][$k];
+                $arr = common_config('db', 'mirror');
+                $k = array_rand($arr);
+                $mirror = $arr[$k];
             } else {
-                $mirror = $config['db']['mirror'];
+                $mirror = common_config('db', 'mirror');
             }
             $config['db']['database'] = $mirror;
         }