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

Commit 73bda54

Browse files
committed
Clarify why we allow empty table names
1 parent c851023 commit 73bda54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wp-includes/sqlite/class-wp-sqlite-translator.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,8 +2818,9 @@ private function strip_sqlite_system_tables( $tables ) {
28182818
$tables,
28192819
function ( $table ) {
28202820
/**
2821-
* By default, we assume the table name is in the result set.
2822-
* Otherwise, if a information_schema table uses a custom name
2821+
* By default, we assume the table name is in the result set,
2822+
* so we allow empty table names to pass through.
2823+
* Otherwise, if an information_schema table uses a custom name
28232824
* for the name/table_name column, the table would be removed.
28242825
*/
28252826
$table_name = '';
@@ -2831,7 +2832,7 @@ function ( $table ) {
28312832
} elseif ( isset( $table['TABLE_NAME'] ) ) {
28322833
$table_name = $table['TABLE_NAME'];
28332834
}
2834-
return ! array_key_exists( $table_name, $this->sqlite_system_tables );
2835+
return '' === $table_name || ! array_key_exists( $table_name, $this->sqlite_system_tables );
28352836
},
28362837
ARRAY_FILTER_USE_BOTH
28372838
)

0 commit comments

Comments
 (0)