mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 04:25:07 +00:00
Suppress errors during option retrieval while installing. see #5771
git-svn-id: http://svn.automattic.com/wordpress/trunk@7405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0f026c38f9
commit
7c83d7abd1
@ -216,11 +216,11 @@ function get_option( $setting ) {
|
|||||||
|
|
||||||
if ( false === $value ) {
|
if ( false === $value ) {
|
||||||
if ( defined( 'WP_INSTALLING' ) )
|
if ( defined( 'WP_INSTALLING' ) )
|
||||||
$show = $wpdb->hide_errors();
|
$supress = $wpdb->suppress_errors();
|
||||||
// expected_slashed ($setting)
|
// expected_slashed ($setting)
|
||||||
$row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" );
|
$row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" );
|
||||||
if ( defined( 'WP_INSTALLING' ) )
|
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
|
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;
|
$value = $row->option_value;
|
||||||
@ -279,10 +279,10 @@ function wp_load_alloptions() {
|
|||||||
$alloptions = wp_cache_get( 'alloptions', 'options' );
|
$alloptions = wp_cache_get( 'alloptions', 'options' );
|
||||||
|
|
||||||
if ( !$alloptions ) {
|
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'" ) )
|
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" );
|
$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
|
||||||
$wpdb->show_errors($show);
|
$wpdb->suppress_errors($suppress);
|
||||||
$alloptions = array();
|
$alloptions = array();
|
||||||
foreach ( (array) $alloptions_db as $o )
|
foreach ( (array) $alloptions_db as $o )
|
||||||
$alloptions[$o->option_name] = $o->option_value;
|
$alloptions[$o->option_name] = $o->option_value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user