From f6fd138e519184a6804d773cd4ba9f682ade2ad6 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 14 Nov 2005 06:51:09 +0000 Subject: [PATCH] Don't return false from get_settings() when installing. Use update_option() when setting the blog title and admin email so that the cache is kept in sync. fixes #1869 git-svn-id: http://svn.automattic.com/wordpress/trunk@3067 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/install.php | 4 ++-- wp-includes/functions.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index e669af2866..dab334d0a5 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -141,8 +141,8 @@ make_db_current_silent(); populate_options(); populate_roles(); -$wpdb->query("UPDATE $wpdb->options SET option_value = '$weblog_title' WHERE option_name = 'blogname'"); -$wpdb->query("UPDATE $wpdb->options SET option_value = '$admin_email' WHERE option_name = 'admin_email'"); +update_option('blogname', $weblog_title); +update_option('admin_email', $admin_email); // Now drop in some default links $wpdb->query("INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, '".$wpdb->escape(__('Blogroll'))."')"); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4b216e7156..756d173a9a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -261,13 +261,16 @@ function url_to_postid($url) { function get_settings($setting) { global $wpdb; - if ( strstr($_SERVER['REQUEST_URI'], 'wp-admin/install.php') || defined('WP_INSTALLING') ) - return false; $value = wp_cache_get($setting, 'options'); if ( false === $value ) { + if ( defined('WP_INSTALLING') ) + $wpdb->hide_errors(); $value = $wpdb->get_row("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'"); + if ( defined('WP_INSTALLING') ) + $wpdb->show_errors(); + if( is_object( $value ) ) { $value = $value->option_value; wp_cache_set($setting, $value, 'options');