diff options
author | Scott Ullrich <sullrich@su.local> | 2010-05-11 13:40:28 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@su.local> | 2010-05-11 13:40:28 -0400 |
commit | 9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707 (patch) | |
tree | 23d761af252bd5ca2a42c0863ab786f44060081b | |
parent | 15269617e8cfaf291ee9b7a162d11fba2e4b9a79 (diff) | |
download | pfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.tar.gz pfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.tar.bz2 pfsense-packages-9a2b6870fb3cb2a0b63d5d3cf40782a5f1dbe707.zip |
Do not foreach() unless configured
-rwxr-xr-x | config/haproxy/haproxy_servers_edit.php | 16 |
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 |