Commit 5d238412 authored by Franco Fichtner's avatar Franco Fichtner

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

PR: https://forum.opnsense.org/index.php?topic=3824
parent b7f42188
...@@ -168,10 +168,7 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error ...@@ -168,10 +168,7 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error
} }
for ($i = 0; $i < count($reqdfields); $i++) { for ($i = 0; $i < count($reqdfields); $i++) {
// why.. do you want to do this? we send data to validate and then validate something else.... if (empty($postdata[$reqdfields[$i]])) {
// 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]])) {
$input_errors[] = sprintf(gettext("The field %s is required."), $reqdfieldsn[$i]); $input_errors[] = sprintf(gettext("The field %s is required."), $reqdfieldsn[$i]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment