From 339993680de4453962d21546a181550bd1cc0f0f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 24 Jun 2022 20:11:31 +0200 Subject: [PATCH] dns/ddclient - validate statistics before usage to prevent missing fields, for now let's assume mtime is always filled, ip apparantly isn't. ref https://forum.opnsense.org/index.php?topic=28835.msg140355 --- dns/ddclient/Makefile | 1 + .../mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 1c97be904..a6ffcf4f3 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php index 24d856e99..b11bcaf7c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php @@ -50,7 +50,7 @@ class AccountField extends ArrayField if (!empty((string)$node->hostnames)) { foreach (explode(",", (string)$node->hostnames) as $hostname) { - if (!empty((self::$current_stats[$hostname]))) { + if (!empty((self::$current_stats[$hostname]) && !empty(self::$current_stats[$hostname]['ip']))) { $stats = self::$current_stats[$hostname]; $current_ip->setValue($stats['ip']); $current_mtime->setValue(date('c', $stats['mtime']));