if ($retdata["success"] && !empty($retdata["body"])) {
$data = json_decode($retdata["body"], true);
- self::discoverServer($data, 2);
+ if (!empty($data)) {
+ self::discoverServer($data, 2);
+ }
if (Config::get('system', 'poco_discovery') > 1) {
$timeframe = Config::get('system', 'poco_discovery_since');
if ($retdata["success"] && !empty($retdata["body"])) {
logger("Fetch all global contacts from the server " . $server["nurl"], LOGGER_DEBUG);
- $success = self::discoverServer(json_decode($retdata["body"], true));
+ $data = json_decode($retdata["body"], true);
+
+ if (!empty($data)) {
+ $success = self::discoverServer($data);
+ }
}
if (!$success && (Config::get('system', 'poco_discovery') > 2)) {
$retdata = Network::curl($url);
if (!empty($retdata['success'])) {
- self::discoverServer(json_decode($retdata['body'], true), 3);
+ $data = json_decode($retdata["body"], true);
+
+ if (!empty($data)) {
+ self::discoverServer($data, 3);
+ }
}
}
}
$h = substr($addr, strpos($addr, '@') + 1);
- if (($h) && (dns_get_record($h, DNS_A + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
+ // Concerning the @ see here: https://stackoverflow.com/questions/36280957/dns-get-record-a-temporary-server-error-occurred
+ if ($h && (@dns_get_record($h, DNS_A + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
return true;
}
- if (($h) && dns_get_record($h, DNS_CNAME + DNS_MX)) {
+ if ($h && @dns_get_record($h, DNS_CNAME + DNS_MX)) {
return true;
}
return false;