Commit 1caf2081 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) fix some warnings/notices in guiconfig.inc

parent 36a069a0
...@@ -161,7 +161,10 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error ...@@ -161,7 +161,10 @@ function do_input_validation($postdata, $reqdfields, $reqdfieldsn, &$input_error
} }
for ($i = 0; $i < count($reqdfields); $i++) { for ($i = 0; $i < count($reqdfields); $i++) {
if ($_POST[$reqdfields[$i]] == "" && $_REQUEST[$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]])) {
$input_errors[] = sprintf(gettext("The field %s is required."), $reqdfieldsn[$i]); $input_errors[] = sprintf(gettext("The field %s is required."), $reqdfieldsn[$i]);
} }
} }
...@@ -477,10 +480,13 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp ...@@ -477,10 +480,13 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp
else else
$pnot = 0; $pnot = 0;
if ($adr['port']) { if (isset($adr['port'])) {
list($pbeginport, $pendport) = explode("-", $adr['port']); if (strpos('-', $adr['port']) !== false) {
if (!$pendport) list($pbeginport, $pendport) = explode("-", $adr['port']);
} else {
$pbeginport = $adr['port'];
$pendport = $pbeginport; $pendport = $pbeginport;
}
} else if (!is_alias($pbeginport) && !is_alias($pendport)) { } else if (!is_alias($pbeginport) && !is_alias($pendport)) {
$pbeginport = "any"; $pbeginport = "any";
$pendport = "any"; $pendport = "any";
......
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