Coding Standards: Use $wpdb::prepare() in wp-admin/maint/repair.php.
Some checks failed
Cleanup Pull Requests / Clean up pull requests (push) Has been cancelled
Coding Standards / PHP coding standards (push) Has been cancelled
Coding Standards / JavaScript coding standards (push) Has been cancelled
End-to-end Tests / Test with SCRIPT_DEBUG disabled (push) Has been cancelled
End-to-end Tests / Test with SCRIPT_DEBUG enabled (push) Has been cancelled
JavaScript Tests / QUnit Tests (push) Has been cancelled
Performance Tests / Determine Matrix (push) Has been cancelled
PHP Compatibility / Check PHP compatibility (push) Has been cancelled
PHPUnit Tests / PHP 7.2 (push) Has been cancelled
PHPUnit Tests / PHP 7.3 (push) Has been cancelled
PHPUnit Tests / PHP 7.4 (push) Has been cancelled
PHPUnit Tests / PHP 8.0 (push) Has been cancelled
PHPUnit Tests / PHP 8.1 (push) Has been cancelled
PHPUnit Tests / PHP 8.2 (push) Has been cancelled
PHPUnit Tests / PHP 8.3 (push) Has been cancelled
PHPUnit Tests / PHP 8.4 (push) Has been cancelled
PHPUnit Tests / html-api-html5lib-tests (push) Has been cancelled
Test Build Processes / Core running from build (push) Has been cancelled
Test Build Processes / Core running from src (push) Has been cancelled
Test Build Processes / Gutenberg running from build (push) Has been cancelled
Test Build Processes / Gutenberg running from src (push) Has been cancelled
Upgrade Develop Version Tests / Build (push) Has been cancelled
Coding Standards / Slack Notifications (push) Has been cancelled
Coding Standards / Failed workflow tasks (push) Has been cancelled
End-to-end Tests / Slack Notifications (push) Has been cancelled
End-to-end Tests / Failed workflow tasks (push) Has been cancelled
JavaScript Tests / Slack Notifications (push) Has been cancelled
JavaScript Tests / Failed workflow tasks (push) Has been cancelled
Performance Tests / ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} (push) Has been cancelled
Performance Tests / Compare (push) Has been cancelled
Performance Tests / Slack Notifications (push) Has been cancelled
Performance Tests / Failed workflow tasks (push) Has been cancelled
PHP Compatibility / Slack Notifications (push) Has been cancelled
PHP Compatibility / Failed workflow tasks (push) Has been cancelled
PHPUnit Tests / Slack Notifications (push) Has been cancelled
PHPUnit Tests / Failed workflow tasks (push) Has been cancelled
Test Build Processes / Slack Notifications (push) Has been cancelled
Test Build Processes / Failed workflow tasks (push) Has been cancelled
Upgrade Develop Version Tests / Upgrade from 4.9 (push) Has been cancelled
Upgrade Develop Version Tests / Upgrade from 6.5 (push) Has been cancelled
Upgrade Develop Version Tests / Upgrade from 6.7 (push) Has been cancelled
Upgrade Develop Version Tests / Upgrade from 6.8-RC1 (push) Has been cancelled
Upgrade Develop Version Tests / Slack Notifications (push) Has been cancelled
Upgrade Develop Version Tests / Failed workflow tasks (push) Has been cancelled
Code Coverage Report / Single site report (push) Has been cancelled
Code Coverage Report / Multisite report (push) Has been cancelled
Code Coverage Report / Slack Notifications (push) Has been cancelled
Code Coverage Report / Failed workflow tasks (push) Has been cancelled
Installation Tests / Build Test Matrix (push) Has been cancelled
Installation Tests / WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }} (push) Has been cancelled
Installation Tests / Slack Notifications (push) Has been cancelled
Installation Tests / Failed workflow tasks (push) Has been cancelled

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

Props aristath, poena, afercia, SergeyBiryukov.
See #63168.

git-svn-id: https://develop.svn.wordpress.org/trunk@60106 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2025-03-29 11:58:07 +00:00
parent 6d0f1857f0
commit 979cd7fa71

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 ) {