From eb6b23e014e1e52c720541e24802e17e19bf81d6 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 31 Mar 2025 17:07:27 +0200 Subject: [PATCH] Fix type when missing $field This happens e.g. for INNODB_BUFFER_PAGE.IS_STALE which is undeclared but returned. --- adminer/select.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 0b7b957a..38912b72 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -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