mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
Fix converting long values to unique_idf
Found by PHP error: Trying to access array offset on null
This commit is contained in:
@@ -396,9 +396,10 @@ if (!$columns && support("table")) {
|
|||||||
}
|
}
|
||||||
$unique_idf = "";
|
$unique_idf = "";
|
||||||
foreach ($unique_array as $key => $val) {
|
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 = (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);
|
$val = md5($val);
|
||||||
}
|
}
|
||||||
$unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val === false ? "f" : $val) : "null%5B%5D=" . urlencode($key));
|
$unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val === false ? "f" : $val) : "null%5B%5D=" . urlencode($key));
|
||||||
|
Reference in New Issue
Block a user