From 3ea273b235e24a68b59a8696ee94e50a47e42e94 Mon Sep 17 00:00:00 2001
From: florian030 <florian@schaal-24.de>
Date: Mon, 7 May 2018 07:29:39 +0200
Subject: [PATCH] remoting.inc.php

---
 interface/lib/classes/remoting.inc.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 2aaf1930f0..fe8b1694c4 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -151,11 +151,13 @@ class remoting {
 							// get the ip for a hostname
 							unset($allowed_ips[$i]);
 							$temp=dns_get_record($allowed, DNS_A+DNS_AAAA);
-							foreach($temp as $t) {
-								if(isset($t['ip'])) $allowed_ips[] = $t['ip'];
-								if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6'];
+							if(is_array($temp) && !empty($temp)) {
+								foreach($temp as $t) {
+									if(isset($t['ip'])) $allowed_ips[] = $t['ip'];
+									if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6'];
+								}
+								unset($temp);
 							}
-							unset($temp);
 						}
 					}
 				}
-- 
GitLab