]> git.joonet.de Git - adminer.git/commitdiff
Fix type when missing $field
authorJakub Vrana <jakub@vrana.cz>
Mon, 31 Mar 2025 15:07:27 +0000 (17:07 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 31 Mar 2025 15:07:27 +0000 (17:07 +0200)
This happens e.g. for INNODB_BUFFER_PAGE.IS_STALE which is undeclared but returned.

adminer/select.inc.php

index 0b7b957a5d3cbd75b9aaeda343c71aa376bae63e..38912b7206aafa75624ab82aba154d6776d94c6e 100644 (file)
@@ -396,7 +396,7 @@ if (!$columns && support("table")) {
                                }
                                $unique_idf = "";
                                foreach ($unique_array as $key => $val) {
-                                       $field = $fields[$key];
+                                       $field = (array) $fields[$key];
                                        if ((JUSH == "sql" || JUSH == "pgsql") && preg_match('~char|text|enum|set~', $field["type"]) && strlen($val) > 64) {
                                                $key = (strpos($key, '(') ? $key : idf_escape($key)); //! columns looking like functions
                                                $key = "MD5(" . (JUSH != 'sql' || preg_match("~^utf8~", $field["collation"]) ? $key : "CONVERT($key USING " . charset(connection()) . ")") . ")";
@@ -411,7 +411,7 @@ if (!$columns && support("table")) {
 
                                foreach ($row as $key => $val) {
                                        if (isset($names[$key])) {
-                                               $field = $fields[$key];
+                                               $field = (array) $fields[$key];
                                                $val = driver()->value($val, $field);
                                                if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
                                                        $email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages