Revision 051b178a
Added by Ermal LUÇI over 15 years ago
etc/inc/gwlb.inc | ||
---|---|---|
150 | 150 |
$i = 2; |
151 | 151 |
foreach($gateways_arr as $name => $gateway) { |
152 | 152 |
/* for dynamic gateways without an IP address we subtitute a local one */ |
153 |
if((is_numeric($gateway['attribute'])) && ($a_gateway_item[$gateway['attribute']]['monitor'] <> "")) {
|
|
153 |
if((is_numeric($gateway['attribute'])) && is_ipaddr($a_gateway_item[$gateway['attribute']]['monitor'])) {
|
|
154 | 154 |
$gateway['monitor'] = $a_gateway_item[$gateway['attribute']]['monitor']; |
155 | 155 |
} else { |
156 | 156 |
if(($gateway['gateway'] == "dynamic") && ($gateway['monitor'])) { |
157 | 157 |
$gateway['monitor'] = "127.0.0.{$i}"; |
158 | 158 |
$i++; |
159 | 159 |
} |
160 |
if($gateway['monitor'] == "") {
|
|
160 |
if(!is_ipaddr($gateway['monitor'])) {
|
|
161 | 161 |
$gateway['monitor'] = $gateway['gateway']; |
162 | 162 |
} |
163 | 163 |
} |
Also available in: Unified diff
Be more strict on validations.