Avoid each() not available in PHP 8
This commit is contained in:
parent
d94adc09cc
commit
697eedc6a1
|
@ -849,19 +849,18 @@ function friendly_url($val) {
|
||||||
/** Print hidden fields
|
/** Print hidden fields
|
||||||
* @param array
|
* @param array
|
||||||
* @param array
|
* @param array
|
||||||
|
* @param string
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function hidden_fields($process, $ignore = array()) {
|
function hidden_fields($process, $ignore = array(), $prefix = '') {
|
||||||
$return = false;
|
$return = false;
|
||||||
while (list($key, $val) = each($process)) {
|
foreach ($process as $key => $val) {
|
||||||
if (!in_array($key, $ignore)) {
|
if (!in_array($key, $ignore)) {
|
||||||
if (is_array($val)) {
|
if (is_array($val)) {
|
||||||
foreach ($val as $k => $v) {
|
hidden_fields($val, array(), $key);
|
||||||
$process[$key . "[$k]"] = $v;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$return = true;
|
$return = true;
|
||||||
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
|
echo '<input type="hidden" name="' . h($prefix ? $prefix . "[$key]" : $key) . '" value="' . h($val) . '">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue