summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-03-30 16:17:06 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-03-30 16:17:06 +0000
commit6df4e01c541ff11106893789bc3af66d35d10de6 (patch)
treee784c357884de972d3205f3e365a6f6868358e49 /etc/inc
parent1a4f31239218c3f4f4079fc98de097a80dd93e92 (diff)
downloadpfsense-6df4e01c541ff11106893789bc3af66d35d10de6.zip
pfsense-6df4e01c541ff11106893789bc3af66d35d10de6.tar.gz
Do not foreach through an item that does not exist
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/vslb.inc12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index 9008fef..3299fa0 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -72,10 +72,11 @@ function slbd_configure() {
$svrcnt = 0;
$svrtxt = "";
$svrtxt = "\t:service-port={$config['load_balancer']['lbpool'][$i]['port']}:\\\n";
- foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
- $svrtxt .= "\t:{$svrcnt}={$lbsvr}:\\\n";
- $svrcnt++;
- }
+ if($config['load_balancer']['lbpool'])
+ foreach ($config['load_balancer']['lbpool'][$i]['servers'] as $lbsvr) {
+ $svrtxt .= "\t:{$svrcnt}={$lbsvr}:\\\n";
+ $svrcnt++;
+ }
$slbdconf .= "\t:method=round-robin:\\\n";
$slbdconf .= "\t:services={$svrcnt}:\\\n";
$slbdconf .= $svrtxt;
@@ -114,6 +115,7 @@ function slbd_configure() {
$svrcnt = 0;
$svrtxt = "";
+ if($vspool['servers'])
foreach ($vspool['servers'] as $lbsvr) {
$lbsvr_split=split("\|", $lbsvr);
$svrtxt .= "\t:{$svrcnt}={$lbsvr_split[1]}:\\\n";
@@ -159,4 +161,4 @@ function slbd_configure() {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud