# HG changeset patch # User Dan # Date 1226201518 18000 # Node ID f82da241eaf86be5b74f4abb96e7ba7184b9f47a # Parent 12485b1d41fd9383f661e1a13cbe0080d45718b2 Fixed system table list; added safeguard against twice prefixing the tables in $system_table_list diff -r 12485b1d41fd -r f82da241eaf8 includes/common.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 ) diff -r 12485b1d41fd -r f82da241eaf8 includes/constants.php --- 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];