Coding Standards: Use $wpdb::prepare() in wp-admin/maint/repair.php.

Follow-up to [11902], [12092], [13224], [13229].

Props aristath, poena, afercia, SergeyBiryukov.
See #63168.
Built from https://develop.svn.wordpress.org/trunk@60106


git-svn-id: http://core.svn.wordpress.org/trunk@59442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-03-29 12:00:31 +00:00
parent 8eac4b5b0b
commit 64bcfc76d0
2 changed files with 5 additions and 5 deletions

View File

@@ -108,7 +108,7 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
// Loop over the tables, checking and repairing as needed.
foreach ( $tables as $table ) {
$check = $wpdb->get_row( "CHECK TABLE $table" );
$check = $wpdb->get_row( $wpdb->prepare( 'CHECK TABLE %i', $table ) );
echo '<p>';
if ( 'OK' === $check->Msg_text ) {
@@ -118,7 +118,7 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
/* translators: 1: Table name, 2: Error message. */
printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
$repair = $wpdb->get_row( "REPAIR TABLE $table" );
$repair = $wpdb->get_row( $wpdb->prepare( 'REPAIR TABLE %i', $table ) );
echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
if ( 'OK' === $repair->Msg_text ) {
@@ -133,14 +133,14 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
}
if ( $okay && $optimize ) {
$analyze = $wpdb->get_row( "ANALYZE TABLE $table" );
$analyze = $wpdb->get_row( $wpdb->prepare( 'ANALYZE TABLE %i', $table ) );
echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
if ( 'Table is already up to date' === $analyze->Msg_text ) {
/* translators: %s: Table name. */
printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
} else {
$optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" );
$optimize = $wpdb->get_row( $wpdb->prepare( 'OPTIMIZE TABLE %i', $table ) );
echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) {

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60104';
$wp_version = '6.9-alpha-60106';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.