mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fixed #6577 - Preserve user input on error
(cherry picked from commit a654d899cd)
This commit is contained in:
parent
e63e23acd3
commit
1e686fe97e
@ -1420,15 +1420,19 @@ foreach ($pkg['fields']['field'] as $pkga) {
|
||||
unset($value);
|
||||
$width = null;
|
||||
|
||||
if ($rowhelper['value'] != "") {
|
||||
$value = $rowhelper['value'];
|
||||
}
|
||||
$fieldname = $rowhelper['fieldname'];
|
||||
$fielddescr = $rowhelper['fielddescr'];
|
||||
|
||||
// if user is editing a record, load in the data.
|
||||
if (isset($id) && $a_pkg[$id]) {
|
||||
print($fieldname); print("<br />");
|
||||
print($_POST[$fieldname.$rowcounter]); print("<br />"); print("<br />");
|
||||
|
||||
// If input validation failed, read the value from the POST data so that hte user's input is not lost
|
||||
if ($get_from_post && isset($_POST[$fieldname.$rowcounter])) {
|
||||
$value = $_POST[$fieldname.$rowcounter];
|
||||
} elseif (isset($id) && $a_pkg[$id]) {
|
||||
$value = $row[$fieldname];
|
||||
}elseif ($rowhelper['value'] != "") {
|
||||
$value = $rowhelper['value'];
|
||||
}
|
||||
|
||||
$type = $rowhelper['type'];
|
||||
@ -1437,7 +1441,7 @@ foreach ($pkg['fields']['field'] as $pkga) {
|
||||
$value = base64_decode($value);
|
||||
}
|
||||
}
|
||||
$fieldname = $rowhelper['fieldname'];
|
||||
|
||||
|
||||
if ($rowhelper['size']) {
|
||||
$size = $rowhelper['size'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user