From 007c97d0d285fe9462e53616d783c3d16881998e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 31 Mar 2025 08:55:23 +0200 Subject: [PATCH] Fix converting long values to unique_idf Found by PHP error: Trying to access array offset on null --- adminer/select.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 81e07af1..0b7b957a 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -396,9 +396,10 @@ if (!$columns && support("table")) { } $unique_idf = ""; foreach ($unique_array as $key => $val) { - if ((JUSH == "sql" || JUSH == "pgsql") && preg_match('~char|text|enum|set~', $fields[$key]["type"]) && strlen($val) > 64) { + $field = $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~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset(connection()) . ")") . ")"; + $key = "MD5(" . (JUSH != 'sql' || preg_match("~^utf8~", $field["collation"]) ? $key : "CONVERT($key USING " . charset(connection()) . ")") . ")"; $val = md5($val); } $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val === false ? "f" : $val) : "null%5B%5D=" . urlencode($key));