in_array() is needle, haystack. Not the othe way round which throws a wrong datatype warning.

Issue 166
This commit is contained in:
Seth Mos 2009-11-28 00:21:42 +01:00
parent f1a1997f45
commit e489f87d99

View File

@ -103,15 +103,15 @@ if ($_POST) {
if (isset($id) && ($a_gateways[$id]) && ($a_gateways[$id] === $gateway))
continue;
if (($gateway['name'] <> "") && (in_array($gateway, $_POST['name']))) {
if (($gateway['name'] <> "") && (in_array($_POST['name'], $gateway))) {
$input_errors[] = "The name \"{$_POST['name']}\" already exists.";
break;
}
if (($gateway['gateway'] <> "") && (in_array($gateway, $_POST['gateway']))) {
if (($gateway['gateway'] <> "") && (in_array($_POST['gateway'], $gateway))) {
$input_errors[] = "The IP address \"{$_POST['gateway']}\" already exists.";
break;
}
if (($gateway['monitor'] <> "") && (in_array($gateway, $gateway['monitor']))) {
if (($gateway['monitor'] <> "") && (in_array($_POST['monitor'], $gateway))) {
$input_errors[] = "The IP address \"{$_POST['monitor']}\" already exists.";
break;
}