Suppress errors during option retrieval while installing. see #5771

git-svn-id: https://develop.svn.wordpress.org/trunk@7405 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-19 23:17:23 +00:00
parent df6429885e
commit a18dc5cb4d
1 changed files with 4 additions and 4 deletions

View File

@ -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;