www: prepare to die! fix validation code now that issue is triggered

PR: https://forum.opnsense.org/index.php?topic=3824
This commit is contained in:
Franco Fichtner 2016-10-23 17:11:01 +02:00
parent b7f4218827
commit 5d238412ae

View File

@ -168,10 +168,7 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error
}
for ($i = 0; $i < count($reqdfields); $i++) {
// why.. do you want to do this? we send data to validate and then validate something else....
// can't now for sure if any page uses this wrong behaviour, but it should die eventually.
// TODO: kill
if (empty($_POST[$reqdfields[$i]]) && empty($_REQUEST[$reqdfields[$i]])) {
if (empty($postdata[$reqdfields[$i]])) {
$input_errors[] = sprintf(gettext("The field %s is required."), $reqdfieldsn[$i]);
}
}