summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2026-02-08 11:35:42 +0100
committerDamien Regad <dregad@mantisbt.org>2026-02-08 11:35:42 +0100
commit60af4651a888d60da577bbfd524c6386cf0044c6 (patch)
tree18dea7cfe156e3d33ab6e416e79a833e4f7b35e6 /drivers
parent3c2a0740cc88deb2ae6981606dce67955f3302e2 (diff)
downloadadodb-60af4651a888d60da577bbfd524c6386cf0044c6.tar.gz
adodb-60af4651a888d60da577bbfd524c6386cf0044c6.tar.bz2
adodb-60af4651a888d60da577bbfd524c6386cf0044c6.zip
Resructure method to prevent array errors if table not found
Fixes #1156 (cherry picked from commit 1738d53e71ba5d29296e738063532f627e7b8837)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/adodb-mysqli.inc.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php
index d894e643..c40e49ae 100644
--- a/drivers/adodb-mysqli.inc.php
+++ b/drivers/adodb-mysqli.inc.php
@@ -953,7 +953,19 @@ class ADODB_mysqli extends ADOConnection {
$table = "$owner.$table";
}
- $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE `%s`', $table));
+ $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);