dns/dyndns: fix a crash report in namecheap error parsing

(cherry picked from commit f2ed0cf14a)
This commit is contained in:
Franco Fichtner 2017-12-13 06:29:49 +00:00
parent 8ca119c8cc
commit 11444ff657
2 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
PLUGIN_NAME= dyndns
PLUGIN_VERSION= 1.4
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Dynamic DNS Support
PLUGIN_MAINTAINER= franco@opnsense.org

View file

@ -954,10 +954,12 @@ class updatedns {
} elseif ((string)$ncresponse->ErrCount === "0") {
$status = "Dynamic DNS: (Success) IP Address Updated Successfully!";
$successful_update = true;
} elseif (is_numeric((string)$ncresponse->ErrCount) && (string)$ncresponse->ErrCount > 0) {
} elseif (isset($ncresponse->ErrCount) && is_numeric((string)$ncresponse->ErrCount) && (string)$ncresponse->ErrCount > 0) {
$status = "Dynamic DNS: (Error) ";
foreach ($xml->errors->children() as $err) {
$status .= (string)$err . " ";
if (isset($ncresponse->errors)) {
foreach ($ncresponse->errors->children() as $err) {
$status .= (string)$err . " ";
}
}
$successful_update = true;
} else {