From 697eedc6a167622b3a47dfe403ec349389bbe9bb Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 6 Dec 2020 12:47:58 +0100 Subject: [PATCH] Avoid each() not available in PHP 8 --- adminer/include/functions.inc.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 4eba85c8..ea9d81b3 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -849,19 +849,18 @@ function friendly_url($val) { /** Print hidden fields * @param array * @param array +* @param string * @return bool */ -function hidden_fields($process, $ignore = array()) { +function hidden_fields($process, $ignore = array(), $prefix = '') { $return = false; - while (list($key, $val) = each($process)) { + foreach ($process as $key => $val) { if (!in_array($key, $ignore)) { if (is_array($val)) { - foreach ($val as $k => $v) { - $process[$key . "[$k]"] = $v; - } + hidden_fields($val, array(), $key); } else { $return = true; - echo ''; + echo ''; } } }