Skip to content

Commit

Permalink
fixes #65
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Dec 28, 2023
1 parent 84c5d69 commit ca47062
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions wp-includes/sqlite/class-wp-sqlite-translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2483,8 +2483,20 @@ private function strip_sqlite_system_tables( $tables ) {
array_filter(
$tables,
function ( $table ) {
$table_name = property_exists( $table, 'Name' ) ? $table->Name : $table->table_name; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
return ! array_key_exists( $table_name, $this->sqlite_system_tables );
$table_name = false;
if ( is_array( $table ) ) {
if ( isset( $table['Name'] ) ) {
$table_name = $table['Name'];
} elseif ( isset( $table['table_name'] ) ) {
$table_name = $table['table_name'];
}
} elseif ( is_object( $table ) ) {
$table_name = property_exists( $table, 'Name' )
? $table->Name // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
: $table->table_name;
}

return $table_name && ! array_key_exists( $table_name, $this->sqlite_system_tables );
},
ARRAY_FILTER_USE_BOTH
)
Expand Down

0 comments on commit ca47062

Please sign in to comment.