Setup: Hide database errors while testing the table prefix.

If DB errors are shown during installation, the table prefix test will also show an error, even though we're deliberately trying to generate that error.

Fixes #40655.


Built from https://develop.svn.wordpress.org/trunk@41631


git-svn-id: http://core.svn.wordpress.org/trunk@41466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2017-09-28 07:58:46 +00:00
parent ef3720ac49
commit 3a4e78f9bd
2 changed files with 3 additions and 1 deletions

View File

@ -276,7 +276,9 @@ switch($step) {
if ( ! empty( $wpdb->error ) )
wp_die( $wpdb->error->get_error_message() . $tryagain_link );
$errors = $wpdb->hide_errors();
$wpdb->query( "SELECT $prefix" );
$wpdb->show_errors( $errors );
if ( ! $wpdb->last_error ) {
// MySQL was able to parse the prefix as a value, which we don't want. Bail.
wp_die( __( '<strong>ERROR</strong>: "Table Prefix" is invalid.' ) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41630';
$wp_version = '4.9-alpha-41631';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.