diff --git a/wp-admin/install-config.php b/wp-admin/install-config.php index a12de63908..4eee8ed5b6 100644 --- a/wp-admin/install-config.php +++ b/wp-admin/install-config.php @@ -123,7 +123,7 @@ switch($step) { case "define('DB_HOST'": fwrite($handle, str_replace("localhost", $dbhost, $line)); break; - case '$table_prefix ': + case '$table_prefix =': fwrite($handle, str_replace('wp_', $prefix, $line)); break; default: diff --git a/wp-admin/install.php b/wp-admin/install.php index 533dbd290c..b26a4e34cc 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -656,8 +656,15 @@ foreach ($geo_option_data as $query) {
OK. We're nearly done now. We just need to ask you a couple of things:
hide_errors(); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f45d37042b..9e37b0f252 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -541,7 +541,8 @@ function url_to_postid($url = '') { /* Options functions */ function get_settings($setting) { - global $wpdb, $cache_settings, $use_cache; + global $wpdb, $cache_settings, $use_cache, $REQUEST_URI; + if (strstr($REQUEST_URI, 'install.php')) return false; if ((empty($cache_settings)) OR (!$use_cache)) { $settings = get_alloptions(); $cache_settings = $settings; diff --git a/wp-settings.php b/wp-settings.php index ea050a9819..252dfb4715 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -17,13 +17,19 @@ $tableoptiontypes = $table_prefix . 'optiontypes'; $tableoptionvalues = $table_prefix . 'optionvalues'; $tableoptiongroups = $table_prefix . 'optiongroups'; $tableoptiongroup_options = $table_prefix . 'optiongroup_options'; +define('WPINC', 'wp-includes'); +require (ABSPATH . WPINC . '/wp-db.php'); + +$wpdb->hide_errors(); +if (!$wpdb->get_row("SELECT * FROM $tableoptions LIMIT 1") && !strstr($REQUEST_URI, 'install.php')) { + die("It doesn't look like you've installed WP yet. Try running install.php."); +} +$wpdb->show_errors(); // This is the name of the include directory. No "/" allowed. -define('WPINC', 'wp-includes'); -require (ABSPATH . 'wp-config-extra.php'); -require (ABSPATH . WPINC . '/wp-db.php'); require (ABSPATH . WPINC . '/functions.php'); +require (ABSPATH . 'wp-config-extra.php'); require (ABSPATH . WPINC . '/template-functions.php'); require (ABSPATH . WPINC . '/class-xmlrpc.php'); require (ABSPATH . WPINC . '/class-xmlrpcs.php'); @@ -35,7 +41,7 @@ require (ABSPATH . WPINC . '/kses.php'); // We should eventually migrate to either calling // get_settings() wherever these are needed OR // accessing a single global $all_settings var -if (!isset($_wp_installing) || !$_wp_installing) { +if (!strstr($REQUEST_URI, 'install.php')) { $siteurl = get_settings('siteurl'); // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" @@ -98,5 +104,7 @@ if (!isset($_wp_installing) || !$_wp_installing) { } //end !$_wp_installing + + require (ABSPATH . WPINC . '/vars.php'); ?> \ No newline at end of file