From 993562ab19dff15ba72c6f7dc39b7533a7c9f277 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 7 Apr 2019 10:19:49 +0200 Subject: [PATCH] dns/dyndns: another PHP 7.2 count() vs. non-array issue PR: https://forum.opnsense.org/index.php?topic=12327.0 --- dns/dyndns/Makefile | 1 + dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index cd5c706f4..1965891a0 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.14 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 01caa7cb9..8d29919db 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -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);