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.



git-svn-id: https://develop.svn.wordpress.org/trunk@41631 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2017-09-28 07:57:22 +00:00
parent 98cdd162b2
commit d93dcaf75f
1 changed files with 2 additions and 0 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.' ) );