Ticket #5495: wpdb-error.diff
| File wpdb-error.diff, 2.1 KB (added by andy, 4 years ago) |
|---|
-
wp-includes/wp-db.php
115 115 <p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>$db</code> database.</p> 116 116 <ul> 117 117 <li>Are you sure it exists?</li> 118 <li>Does the user <code>".DB_USER."</code> have permission to use the <code>$db</code> database?</li> 118 119 <li>On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?</li> 119 120 </ul> 120 121 <p>If you don't know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>"); … … 462 463 * @param string $message 463 464 */ 464 465 function bail($message) { // Just wraps errors in a nice header and footer 465 if ( !$this->show_errors ) 466 if ( !$this->show_errors ) { 467 if ( class_exists('WP_Error') ) 468 $this->error = new WP_Error('500', $message); 469 else 470 $this->error = $message; 466 471 return false; 472 } 467 473 wp_die($message); 468 474 } 475 469 476 /** 470 477 * Checks wether of not the database version is high enough to support the features WordPress uses 471 478 * @global $wp_version -
wp-admin/setup-config.php
6 6 7 7 require_once('../wp-includes/compat.php'); 8 8 require_once('../wp-includes/functions.php'); 9 require_once('../wp-includes/classes.php'); 9 10 10 11 if (!file_exists('../wp-config-sample.php')) 11 12 wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); … … 164 165 165 166 // We'll fail here if the values are no good. 166 167 require_wp_db(); 168 if ( !empty($wpdb->error) ) 169 wp_die($wpdb->error->get_error_message()); 170 167 171 $handle = fopen('../wp-config.php', 'w'); 168 172 169 173 foreach ($configFile as $line_num => $line) {
