dns/dyndns: another PHP 7.2 count() vs. non-array issue

PR: https://forum.opnsense.org/index.php?topic=12327.0
This commit is contained in:
Franco Fichtner
2019-04-07 10:19:49 +02:00
parent 7993eb5737
commit 993562ab19
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
PLUGIN_NAME= dyndns
PLUGIN_VERSION= 1.14
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Dynamic DNS Support
PLUGIN_MAINTAINER= franco@opnsense.org
@@ -751,7 +751,7 @@ class updatedns
$getHostId = "$dnsRecordsUrl?name=$fqdn&type=$recordType";
curl_setopt($ch, CURLOPT_URL, $getHostId);
$output = json_decode(curl_exec($ch));
$recordCount = count($output->result);
$recordCount = !empty($output->result) ? count($output->result) : 0;
if ($recordCount === 0) {
// create record
curl_setopt($ch, CURLOPT_URL, $dnsRecordsUrl);