From 7c83d7abd18589baa89bad1559a01c2cea5af83d Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 19 Mar 2008 23:17:23 +0000 Subject: [PATCH] Suppress errors during option retrieval while installing. see #5771 git-svn-id: http://svn.automattic.com/wordpress/trunk@7405 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 13dbb47f30..da51e12cbb 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -216,11 +216,11 @@ function get_option( $setting ) { if ( false === $value ) { if ( defined( 'WP_INSTALLING' ) ) - $show = $wpdb->hide_errors(); + $supress = $wpdb->suppress_errors(); // expected_slashed ($setting) $row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" ); if ( defined( 'WP_INSTALLING' ) ) - $wpdb->show_errors($show); + $wpdb->suppress_errors($suppress); if ( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values $value = $row->option_value; @@ -279,10 +279,10 @@ function wp_load_alloptions() { $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( !$alloptions ) { - $show = $wpdb->hide_errors(); + $suppress = $wpdb->suppress_errors(); if ( !$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) ) $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ); - $wpdb->show_errors($show); + $wpdb->suppress_errors($suppress); $alloptions = array(); foreach ( (array) $alloptions_db as $o ) $alloptions[$o->option_name] = $o->option_value;