From 1738d53e71ba5d29296e738063532f627e7b8837 Mon Sep 17 00:00:00 2001 From: Mark Newnham Date: Mon, 19 Jan 2026 18:10:05 -0700 Subject: Resructure method to prevent array errors if table not found --- drivers/adodb-mysqli.inc.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index 71fb346b..36a3f207 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -947,12 +947,20 @@ class ADODB_mysqli extends ADOConnection { $table = "$owner.$table"; } - $a_create_table = array_change_key_case( - $this->getRow( - sprintf('SHOW CREATE TABLE `%s`', $table)), - CASE_UPPER + $showCreate = $this->getRow( + sprintf('SHOW CREATE TABLE `%s`', $table) ); + if ( !$showCreate || !is_array($showCreate) ) { + /* + * Invalid table or owner provided + */ + $this->setFetchMode($savem); + return false; + } + + $a_create_table = array_change_key_case($showCreate, CASE_UPPER); + $this->setFetchMode($savem); $create_sql = $a_create_table["CREATE TABLE"] ?? $a_create_table["CREATE VIEW"]; -- cgit v1.3