summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2026-01-27 17:15:15 +0100
committerDamien Regad <dregad@mantisbt.org>2026-01-27 17:15:15 +0100
commit6ad429812a9de4042c36f10e6ca54ac5467028f9 (patch)
tree159d0be14cd80fb2022da81d568ab4c26b87cb07
parentffdce207b10c6be90fb4093338dd7c4338e735bf (diff)
downloadadodb-6ad429812a9de4042c36f10e6ca54ac5467028f9.tar.gz
adodb-6ad429812a9de4042c36f10e6ca54ac5467028f9.tar.bz2
adodb-6ad429812a9de4042c36f10e6ca54ac5467028f9.zip
Fix regression in metaTables()
When the driver does not override metaTables() and the $metaTablesSql statement only returns the table name and not the type, a PHP warning occurs: Undefined array key 1 in .../adodb.inc.php on line 3284 Check if the 2nd column (type) exists in the recordset, and only call array_filter() when it does. Fixes #1132
-rw-r--r--adodb.inc.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/adodb.inc.php b/adodb.inc.php
index 1eb1f7f0..84b64e09 100644
--- a/adodb.inc.php
+++ b/adodb.inc.php
@@ -3232,9 +3232,9 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
* Returns an array of table names and/or views in the database.
*
* @param string|bool $ttype Can be either `TABLE`, `VIEW`, or false.
- * - If false, both views and tables are returned.
- * - `TABLE` (or `T`) returns only tables
- * - `VIEW` (or `V` returns only views
+ * - If false, both views and tables are returned.
+ * - `TABLE` (or `T`) returns only tables
+ * - `VIEW` (or `V` returns only views
* @param string|bool $showSchema Prepends the schema/user to the table name,
* eg. USER.TABLE
* @param string|bool $mask Input mask - not supported by all drivers
@@ -3272,7 +3272,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
$res = $rs->getArray();
// Filter result to keep only the selected type
- if ($res && $ttype) {
+ if ($res && $ttype && isset($res[0][1])) {
$ttype = strtoupper($ttype[0]);
$res = array_filter($res,
/**
@@ -5046,7 +5046,7 @@ class ADORecordSet implements IteratorAggregate {
* @return bool|ADOFetchObj The object with properties set to the current row's fields.
*/
function fetchObject($isUpper = true) {
-
+
if (!$this->fields) {
/*
* past EOF
@@ -5057,7 +5057,7 @@ class ADORecordSet implements IteratorAggregate {
$casing = $isUpper ? CASE_UPPER : CASE_LOWER;
$fields = array_change_key_case($this->fields, $casing);
-
+
return new ADOFetchObj($fields);
}