|
108 | 108 |
|
109 | 109 | // Loop over the tables, checking and repairing as needed. |
110 | 110 | foreach ( $tables as $table ) { |
111 | | - $check = $wpdb->get_row( "CHECK TABLE $table" ); |
| 111 | + $check = $wpdb->get_row( $wpdb->prepare( 'CHECK TABLE %i', $table ) ); |
112 | 112 |
|
113 | 113 | echo '<p>'; |
114 | 114 | if ( 'OK' === $check->Msg_text ) { |
|
118 | 118 | /* translators: 1: Table name, 2: Error message. */ |
119 | 119 | printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table…' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ); |
120 | 120 |
|
121 | | - $repair = $wpdb->get_row( "REPAIR TABLE $table" ); |
| 121 | + $repair = $wpdb->get_row( $wpdb->prepare( 'REPAIR TABLE %i', $table ) ); |
122 | 122 |
|
123 | 123 | echo '<br /> '; |
124 | 124 | if ( 'OK' === $repair->Msg_text ) { |
|
133 | 133 | } |
134 | 134 |
|
135 | 135 | if ( $okay && $optimize ) { |
136 | | - $analyze = $wpdb->get_row( "ANALYZE TABLE $table" ); |
| 136 | + $analyze = $wpdb->get_row( $wpdb->prepare( 'ANALYZE TABLE %i', $table ) ); |
137 | 137 |
|
138 | 138 | echo '<br /> '; |
139 | 139 | if ( 'Table is already up to date' === $analyze->Msg_text ) { |
140 | 140 | /* translators: %s: Table name. */ |
141 | 141 | printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" ); |
142 | 142 | } else { |
143 | | - $optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" ); |
| 143 | + $optimize = $wpdb->get_row( $wpdb->prepare( 'OPTIMIZE TABLE %i', $table ) ); |
144 | 144 |
|
145 | 145 | echo '<br /> '; |
146 | 146 | if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) { |
|
0 commit comments