aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@su.local>2010-05-11 13:40:28 -0400
committerScott Ullrich <sullrich@su.local>2010-05-11 13:40:28 -0400
commit9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707 (patch)
tree23d761af252bd5ca2a42c0863ab786f44060081b /config
parent15269617e8cfaf291ee9b7a162d11fba2e4b9a79 (diff)
downloadpfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.tar.gz
pfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.tar.bz2
pfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.zip
Do not foreach() unless configured
Diffstat (limited to 'config')
-rwxr-xr-xconfig/haproxy/haproxy_servers_edit.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/config/haproxy/haproxy_servers_edit.php b/config/haproxy/haproxy_servers_edit.php
index 5a37e7a2..5c747277 100755
--- a/config/haproxy/haproxy_servers_edit.php
+++ b/config/haproxy/haproxy_servers_edit.php
@@ -342,13 +342,15 @@ function clearcombo(){
function row_helper() {
global $pconfig, $a_backend;
$options = "";
- foreach ($a_backend as $backend) {
- $options .= "<option value='{$backend['name']}'";
- if($backend['name'] == $pconfig['backend'])
- $options .= "SELECTED";
- $options .= ">";
- $options .= $backend['name'];
- $options .= "</option>";
+ if($a_backend) {
+ foreach ($a_backend as $backend) {
+ $options .= "<option value='{$backend['name']}'";
+ if($backend['name'] == $pconfig['backend'])
+ $options .= "SELECTED";
+ $options .= ">";
+ $options .= $backend['name'];
+ $options .= "</option>";
+ }
}
echo <<<EOF