Skip to content

Commit 70c0ea9

Browse files
committed
Clarify why we allow empty table names
1 parent 7cf06a9 commit 70c0ea9

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
@@ -2808,8 +2808,9 @@ private function strip_sqlite_system_tables( $tables ) {
28082808
$tables,
28092809
function ( $table ) {
28102810
/**
2811-
* By default, we assume the table name is in the result set.
2812-
* Otherwise, if a information_schema table uses a custom name
2811+
* By default, we assume the table name is in the result set,
2812+
* so we allow empty table names to pass through.
2813+
* Otherwise, if an information_schema table uses a custom name
28132814
* for the name/table_name column, the table would be removed.
28142815
*/
28152816
$table_name = '';
@@ -2821,7 +2822,7 @@ function ( $table ) {
28212822
} elseif ( isset( $table['TABLE_NAME'] ) ) {
28222823
$table_name = $table['TABLE_NAME'];
28232824
}
2824-
return ! array_key_exists( $table_name, $this->sqlite_system_tables );
2825+
return '' === $table_name || ! array_key_exists( $table_name, $this->sqlite_system_tables );
28252826
},
28262827
ARRAY_FILTER_USE_BOTH
28272828
)

0 commit comments

Comments
 (0)