From 22eb9c1d996a4920435286e536c197a0ab8db7ea Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 22 Dec 2007 17:45:30 +0000 Subject: [PATCH] Show DB errors if WP_DEBUG and if installing. see #5473 git-svn-id: https://develop.svn.wordpress.org/trunk@6469 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/install.php | 12 +++++++----- wp-includes/wp-db.php | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index 545461f485..6f4d7e3e79 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -66,9 +66,10 @@ switch($step) { error) ) - wp_die($wpdb->error->get_error_message()); - display_header(); + if ( !empty($wpdb->error) ) + wp_die($wpdb->error->get_error_message()); + + display_header(); // Fill in the data we gathered $weblog_title = stripslashes($_POST['weblog_title']); $admin_email = stripslashes($_POST['admin_email']); @@ -82,8 +83,9 @@ switch($step) { die(__('ERROR: that isn\'t a valid e-mail address. E-mail addresses look like: username@example.com')); } - $result = wp_install($weblog_title, 'admin', $admin_email, $public); - extract($result, EXTR_SKIP); + $wpdb->show_errors(); + $result = wp_install($weblog_title, 'admin', $admin_email, $public); + extract($result, EXTR_SKIP); ?>

diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 82c4ac20c2..5c5af7601f 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -55,6 +55,9 @@ class wpdb { function __construct($dbuser, $dbpassword, $dbname, $dbhost) { register_shutdown_function(array(&$this, "__destruct")); + if ( defined('WP_DEBUG') and WP_DEBUG == true ) + $this->show_errors(); + if ( defined('DB_CHARSET') ) $this->charset = DB_CHARSET;