From 2b0e2d62a28f7c1da98056477416c55d42384939 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Dec 2020 15:48:15 +0000 Subject: [PATCH] Database: Check the correct value for displaying the "Successfully repaired table" or "Failed to repair" messages on Database Repair screen. Additionally, rename the variables holding the results of `ANALYZE TABLE` and `OPTIMIZE TABLE` requests, for clarity. Props mehrshaddarzi. Fixes #51932. git-svn-id: https://develop.svn.wordpress.org/trunk@49750 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/maint/repair.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/maint/repair.php b/src/wp-admin/maint/repair.php index 853cc6c8f4..b4219b30ad 100644 --- a/src/wp-admin/maint/repair.php +++ b/src/wp-admin/maint/repair.php @@ -106,34 +106,34 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) { $repair = $wpdb->get_row( "REPAIR TABLE $table" ); echo '
    '; - if ( 'OK' === $check->Msg_text ) { + if ( 'OK' === $repair->Msg_text ) { /* translators: %s: Table name. */ printf( __( 'Successfully repaired the %s table.' ), "$table" ); } else { /* translators: 1: Table name, 2: Error message. */ - printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ) . '
'; - $problems[ $table ] = $check->Msg_text; + printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$repair->Msg_text" ) . '
'; + $problems[ $table ] = $repair->Msg_text; $okay = false; } } if ( $okay && $optimize ) { - $check = $wpdb->get_row( "ANALYZE TABLE $table" ); + $analyze = $wpdb->get_row( "ANALYZE TABLE $table" ); echo '
    '; - if ( 'Table is already up to date' === $check->Msg_text ) { + if ( 'Table is already up to date' === $analyze->Msg_text ) { /* translators: %s: Table name. */ printf( __( 'The %s table is already optimized.' ), "$table" ); } else { - $check = $wpdb->get_row( "OPTIMIZE TABLE $table" ); + $optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" ); echo '
    '; - if ( 'OK' === $check->Msg_text || 'Table is already up to date' === $check->Msg_text ) { + if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) { /* translators: %s: Table name. */ printf( __( 'Successfully optimized the %s table.' ), "$table" ); } else { /* translators: 1: Table name. 2: Error message. */ - printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ); + printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "$table", "$optimize->Msg_text" ); } } }