Allow arrays to be ignored in hidden_fields()

This commit is contained in:
Jakub Vrana 2014-03-21 22:45:38 -07:00
parent cd64b707bd
commit 619b49c3d4

View file

@ -747,12 +747,14 @@ function friendly_url($val) {
*/
function hidden_fields($process, $ignore = array()) {
while (list($key, $val) = each($process)) {
if (is_array($val)) {
foreach ($val as $k => $v) {
$process[$key . "[$k]"] = $v;
if (!in_array($key, $ignore)) {
if (is_array($val)) {
foreach ($val as $k => $v) {
$process[$key . "[$k]"] = $v;
}
} else {
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
}
} elseif (!in_array($key, $ignore)) {
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
}
}
}