aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2015-05-25 15:55:23 +0200
committerPiBa-NL <pba_2k3@yahoo.com>2015-05-25 15:55:23 +0200
commit5c5fd7560c8fa5c01ae862af72a941746301227e (patch)
tree74dad949f17d0c2fa12aad2447424e89a6c395eb
parentbeaf6041ecfce94e5f8485b8bd67f1308205fa6c (diff)
downloadpfsense-packages-5c5fd7560c8fa5c01ae862af72a941746301227e.tar.gz
pfsense-packages-5c5fd7560c8fa5c01ae862af72a941746301227e.tar.bz2
pfsense-packages-5c5fd7560c8fa5c01ae862af72a941746301227e.zip
haproxy-devel, code formatting & skip dns_get_record when nothing is requested.
-rw-r--r--config/haproxy-devel/pkg/haproxy_utils.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/config/haproxy-devel/pkg/haproxy_utils.inc b/config/haproxy-devel/pkg/haproxy_utils.inc
index 1e5a23fc..3d841a25 100644
--- a/config/haproxy-devel/pkg/haproxy_utils.inc
+++ b/config/haproxy-devel/pkg/haproxy_utils.inc
@@ -42,15 +42,21 @@ class haproxy_utils {
$recordtypes = 0;
foreach($types as $type){
switch ($type) {
- case 'A': $recordtypes += DNS_A; break;
- case 'AAAA': $recordtypes += DNS_AAAA; break;
+ case 'A':
+ $recordtypes += DNS_A;
+ break;
+ case 'AAAA':
+ $recordtypes += DNS_AAAA;
+ break;
}
}
+ if ($recordtypes == 0)
+ return $result;
+
$dnsresult = dns_get_record($host, $recordtypes);
foreach($dnsresult as $item) {
- $type = $item['type'];
- $newitem["typeid"] = $type;
- switch ($type) {
+ $newitem["typeid"] = $item['type'];
+ switch ($item['type']) {
case 'A':
$newitem["data"] = $item['ip'];
break;