| @@ -438,18 +438,18 @@ | ||
| 438 | 438 | |
| 439 | 439 | if ( empty( $currentVersion ) ) { |
| 440 | 440 | $this->wpdb->query( 'ALTER TABLE ' . $this->table_name( 'wp_logs_archive' ) . ' ADD COLUMN archived_at int(11) NOT NULL DEFAULT 0' ); //phpcs:ignore -- ok. |
| 441 | 441 | } else { |
| 442 | - $column = $this->wpdb->get_results( | |
| 443 | - $this->wpdb->prepare( // phpcs:ignore -- NOSONAR - custom query ok. | |
| 444 | - "SHOW COLUMNS FROM {$archive} LIKE %s", //phpcs:ignore -- custom query ok. | |
| 442 | + $column = $this->wpdb->get_results( // phpcs:ignore PluginCheck.Security.DirectDB.UnescapedDBParameter -- $archive is an internal MainWP table identifier; column name is bound via prepare(). | |
| 443 | + $this->wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table identifiers cannot be placeholders; $archive comes from table_name(). | |
| 444 | + "SHOW COLUMNS FROM {$archive} LIKE %s", | |
| 445 | 445 | 'archived_at' |
| 446 | 446 | ) |
| 447 | 447 | ); |
| 448 | 448 | |
| 449 | 449 | if ( empty( $column ) ) { |
| 450 | - $this->wpdb->query( | |
| 451 | - "ALTER TABLE {$archive} ADD COLUMN archived_at INT(11) NOT NULL DEFAULT 0" //phpcs:ignore -- ok. | |
| 450 | + $this->wpdb->query( // phpcs:ignore PluginCheck.Security.DirectDB.UnescapedDBParameter -- $archive is an internal MainWP table identifier; ALTER TABLE has no user input. | |
| 451 | + "ALTER TABLE {$archive} ADD COLUMN archived_at INT(11) NOT NULL DEFAULT 0" | |
| 452 | 452 | ); |
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | } |