summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/adodb-mysqli.inc.php16
1 files 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"];