From e489f87d99bbbc88a7eddf4a53f8db24490d685c Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Sat, 28 Nov 2009 00:21:42 +0100 Subject: [PATCH] in_array() is needle, haystack. Not the othe way round which throws a wrong datatype warning. Issue 166 --- usr/local/www/system_gateways_edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 687c8c4929..6c192a8143 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -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; }