mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Suppress display of DB error messages by default. Props filosofo. see #5473
git-svn-id: https://develop.svn.wordpress.org/trunk@6391 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -206,11 +206,11 @@ function get_option( $setting ) {
|
||||
|
||||
if ( false === $value ) {
|
||||
if ( defined( 'WP_INSTALLING' ) )
|
||||
$wpdb->hide_errors();
|
||||
$show = $wpdb->hide_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();
|
||||
$wpdb->show_errors($show);
|
||||
|
||||
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;
|
||||
@@ -246,10 +246,10 @@ function form_option( $option ) {
|
||||
|
||||
function get_alloptions() {
|
||||
global $wpdb, $wp_queries;
|
||||
$wpdb->hide_errors();
|
||||
$show = $wpdb->hide_errors();
|
||||
if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
|
||||
$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
|
||||
$wpdb->show_errors();
|
||||
$wpdb->show_errors($show);
|
||||
|
||||
foreach ( $options as $option ) {
|
||||
// "When trying to design a foolproof system,
|
||||
@@ -269,10 +269,10 @@ function wp_load_alloptions() {
|
||||
$alloptions = wp_cache_get( 'alloptions', 'options' );
|
||||
|
||||
if ( !$alloptions ) {
|
||||
$wpdb->hide_errors();
|
||||
$show = $wpdb->hide_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();
|
||||
$wpdb->show_errors($show);
|
||||
$alloptions = array();
|
||||
foreach ( (array) $alloptions_db as $o )
|
||||
$alloptions[$o->option_name] = $o->option_value;
|
||||
@@ -949,9 +949,9 @@ function is_blog_installed() {
|
||||
if ( wp_cache_get('is_blog_installed') )
|
||||
return true;
|
||||
|
||||
$wpdb->hide_errors();
|
||||
$show = $wpdb->hide_errors();
|
||||
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
|
||||
$wpdb->show_errors();
|
||||
$wpdb->show_errors($show);
|
||||
|
||||
$installed = !empty( $installed ) ? true : false;
|
||||
wp_cache_set('is_blog_installed', $installed);
|
||||
|
||||
Reference in New Issue
Block a user