Make WordPress Core


Ignore:
Timestamp:
12/16/2007 09:38:24 PM (17 years ago)
Author:
ryan
Message:

Suppress display of DB error messages by default. Props filosofo. see #5473

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r6390 r6391  
    207207        if ( false === $value ) {
    208208            if ( defined( 'WP_INSTALLING' ) )
    209                 $wpdb->hide_errors();
     209                $show = $wpdb->hide_errors();
    210210            // expected_slashed ($setting)
    211211            $row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" );
    212212            if ( defined( 'WP_INSTALLING' ) )
    213                 $wpdb->show_errors();
     213                $wpdb->show_errors($show);
    214214
    215215            if ( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values
     
    247247function get_alloptions() {
    248248    global $wpdb, $wp_queries;
    249     $wpdb->hide_errors();
     249    $show = $wpdb->hide_errors();
    250250    if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
    251251        $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
    252     $wpdb->show_errors();
     252    $wpdb->show_errors($show);
    253253
    254254    foreach ( $options as $option ) {
     
    270270
    271271    if ( !$alloptions ) {
    272         $wpdb->hide_errors();
     272        $show = $wpdb->hide_errors();
    273273        if ( !$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
    274274            $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
    275         $wpdb->show_errors();
     275        $wpdb->show_errors($show);
    276276        $alloptions = array();
    277277        foreach ( (array) $alloptions_db as $o )
     
    950950        return true;
    951951
    952     $wpdb->hide_errors();
     952    $show = $wpdb->hide_errors();
    953953    $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
    954     $wpdb->show_errors();
     954    $wpdb->show_errors($show);
    955955
    956956    $installed = !empty( $installed ) ? true : false;
Note: See TracChangeset for help on using the changeset viewer.