Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit c745a66

Browse files
committed
Unify quoting also for $wpdb->blogs table name
1 parent 838967a commit c745a66

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wp-includes/sqlite-ast/class-wp-sqlite-information-schema-reconstructor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,12 @@ private function get_wp_create_table_statements(): array {
177177
* of all existing blogs, independent of any filters and actions that
178178
* could possibly alter the results of a "get_sites()" call.
179179
*/
180-
$stmt = $this->driver->execute_sqlite_query( "SELECT blog_id FROM {$wpdb->blogs}" );
181-
$blog_ids = $stmt->fetchAll( PDO::FETCH_COLUMN );
180+
$blog_ids = $this->driver->execute_sqlite_query(
181+
sprintf(
182+
'SELECT blog_id FROM %s',
183+
$this->connection->quote_identifier( $wpdb->blogs )
184+
)
185+
)->fetchAll( PDO::FETCH_COLUMN );
182186
foreach ( $blog_ids as $blog_id ) {
183187
$schema .= wp_get_db_schema( 'blog', (int) $blog_id );
184188
}

0 commit comments

Comments
 (0)