Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
authorDan
Sat, 08 Nov 2008 22:31:58 -0500
changeset 719 f82da241eaf8
parent 718 12485b1d41fd
child 720 e2762777b170
Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list
includes/common.php
includes/constants.php
--- a/includes/common.php	Sun Nov 02 01:42:17 2008 -0400
+++ b/includes/common.php	Sat Nov 08 22:31:58 2008 -0500
@@ -236,6 +236,16 @@
   }
 }
 
+// Build the list of system tables (this is mostly done in constants.php, but that's before table_prefix is known)
+if ( defined('table_prefix') && !defined('ENANO_TABLELIST_PREFIXED') )
+{
+  define('ENANO_TABLELIST_PREFIXED', 1);
+  foreach ( $system_table_list as $i => $_ )
+  {
+    $system_table_list[$i] = table_prefix . $system_table_list[$i];
+  }
+}
+
 // Select and fetch the site configuration
 $e = $db->sql_query('SELECT config_name, config_value FROM '.table_prefix.'config;');
 if ( !$e )
--- a/includes/constants.php	Sun Nov 02 01:42:17 2008 -0400
+++ b/includes/constants.php	Sat Nov 08 22:31:58 2008 -0500
@@ -234,11 +234,16 @@
     'language',
     'language_strings',
     'lockout',
-    'search_index'
+    'search_index',
+    'captcha',
+    'diffiehellman',
+    'plugins',
+    'ranks'
   );
 
-if ( defined('table_prefix') )
+if ( defined('table_prefix') && !defined('ENANO_TABLELIST_PREFIXED') )
 {
+  define('ENANO_TABLELIST_PREFIXED', 1);
   foreach ( $system_table_list as $i => $_ )
   {
     $system_table_list[$i] = table_prefix . $system_table_list[$i];