diff options
author | Phil Davis <phil.davis@inf.org> | 2015-02-26 22:24:00 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-02-26 22:24:00 +0545 |
commit | 918bdf0d45e032dd4413fd5051eb781accb6a86c (patch) | |
tree | b65487132192a1dd46217e8cc261103384b4aa0f /etc/inc/gwlb.inc | |
parent | 9ba8799777c7f9e73cce3f1c2b9c9b303ffd9557 (diff) | |
download | pfsense-918bdf0d45e032dd4413fd5051eb781accb6a86c.zip pfsense-918bdf0d45e032dd4413fd5051eb781accb6a86c.tar.gz |
More style guide changes
In gwlb.inc at line 676 and 779 I added an extra set of brackets. In the
"if" clause as a whole there were a mix of && and || used that were
relying on the PHP standard that && has precedence over ||
In actual fact the original code should have been working fine, the
extra brackets make sure that the intention is clear.
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index a1aedb1..68af1ff 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -269,18 +269,24 @@ EOD; ## How often the probe should be sent if (!empty($gateway['interval']) && is_numeric($gateway['interval'])) { $interval = intval($gateway['interval']); # Restrict to Integer - if ($interval < 1) $interval = 1; # Minimum - if ($interval != $apinger_default['interval']) # If not default value + if ($interval < 1) { + $interval = 1; # Minimum + } + if ($interval != $apinger_default['interval']) { # If not default value $apingercfg .= " interval " . $interval . "s\n"; + } } ## How many replies should be used to compute average delay ## for controlling "delay" alarms if (!empty($gateway['avg_delay_samples']) && is_numeric($gateway['avg_delay_samples'])) { $avg_delay_samples = intval($gateway['avg_delay_samples']); # Restrict to Integer - if ($avg_delay_samples < 1) $avg_delay_samples = 1; # Minimum - if ($avg_delay_samples != $apinger_default['avg_delay_samples']) # If not default value + if ($avg_delay_samples < 1) { + $avg_delay_samples = 1; # Minimum + } + if ($avg_delay_samples != $apinger_default['avg_delay_samples']) { # If not default value $apingercfg .= " avg_delay_samples " . $avg_delay_samples . "\n"; + } } ## How many probes should be used to compute average loss @@ -667,7 +673,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive /* automatically skip known static and dynamic gateways that were previously processed */ foreach ($gateways_arr_temp as $gateway_item) { if ((($ifname == $gateway_item['friendlyiface'] && $friendly == $gateway_item['name'])&& ($gateway['ipprotocol'] == $gateway_item['ipprotocol'])) || - ($ifname == $gateway_item['friendlyiface'] && $gateway_item['dynamic'] == true) && ($gateway['ipprotocol'] == $gateway_item['ipprotocol'])) { + (($ifname == $gateway_item['friendlyiface'] && $gateway_item['dynamic'] == true) && ($gateway['ipprotocol'] == $gateway_item['ipprotocol']))) { continue 2; } } @@ -770,7 +776,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive /* automatically skip known static and dynamic gateways that were previously processed */ foreach ($gateways_arr_temp as $gateway_item) { if ((($ifname == $gateway_item['friendlyiface'] && $friendly == $gateway_item['name']) && ($gateway['ipprotocol'] == $gateway_item['ipprotocol'])) || - ($ifname == $gateway_item['friendlyiface'] && $gateway_item['dynamic'] == true) && ($gateway['ipprotocol'] == $gateway_item['ipprotocol'])) { + (($ifname == $gateway_item['friendlyiface'] && $gateway_item['dynamic'] == true) && ($gateway['ipprotocol'] == $gateway_item['ipprotocol']))) { continue 2; } } |