From ca470623906dd95b0f23385d7c38e7797b81da4f Mon Sep 17 00:00:00 2001 From: Aristeides Stathopoulos Date: Thu, 28 Dec 2023 11:15:49 +0200 Subject: [PATCH] fixes #65 --- .../sqlite/class-wp-sqlite-translator.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/wp-includes/sqlite/class-wp-sqlite-translator.php b/wp-includes/sqlite/class-wp-sqlite-translator.php index 168b6f08..9c784244 100644 --- a/wp-includes/sqlite/class-wp-sqlite-translator.php +++ b/wp-includes/sqlite/class-wp-sqlite-translator.php @@ -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 )