From: Jakub Vrana Date: Mon, 31 Mar 2025 15:07:27 +0000 (+0200) Subject: Fix type when missing $field X-Git-Tag: v5.1.1~32 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=eb6b23e014e1e52c720541e24802e17e19bf81d6;p=adminer.git Fix type when missing $field This happens e.g. for INNODB_BUFFER_PAGE.IS_STALE which is undeclared but returned. --- 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