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
}
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]);
}
}
......@@ -477,10 +480,13 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp
else
$pnot = 0;
if ($adr['port']) {
list($pbeginport, $pendport) = explode("-", $adr['port']);
if (!$pendport)
if (isset($adr['port'])) {
if (strpos('-', $adr['port']) !== false) {
list($pbeginport, $pendport) = explode("-", $adr['port']);
} else {
$pbeginport = $adr['port'];
$pendport = $pbeginport;
}
} else if (!is_alias($pbeginport) && !is_alias($pendport)) {
$pbeginport = "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