From 051b178ac4ccdfabdf9dbf951d9243f68fb89e1e Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 29 Mar 2010 11:00:30 +0000 Subject: [PATCH] Be more strict on validations. --- etc/inc/gwlb.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index e53673a3dc..1b33cc17ef 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -150,14 +150,14 @@ EOD; $i = 2; foreach($gateways_arr as $name => $gateway) { /* for dynamic gateways without an IP address we subtitute a local one */ - if((is_numeric($gateway['attribute'])) && ($a_gateway_item[$gateway['attribute']]['monitor'] <> "")) { + if((is_numeric($gateway['attribute'])) && is_ipaddr($a_gateway_item[$gateway['attribute']]['monitor'])) { $gateway['monitor'] = $a_gateway_item[$gateway['attribute']]['monitor']; } else { if(($gateway['gateway'] == "dynamic") && ($gateway['monitor'])) { $gateway['monitor'] = "127.0.0.{$i}"; $i++; } - if($gateway['monitor'] == "") { + if(!is_ipaddr($gateway['monitor'])) { $gateway['monitor'] = $gateway['gateway']; } }