mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
dns/dnydns: support googledomains wildcards, rework logic; closes #1280
Make this more readable and extensible for the future.
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
PLUGIN_NAME= dyndns
|
||||
PLUGIN_VERSION= 1.13
|
||||
PLUGIN_VERSION= 1.14
|
||||
PLUGIN_COMMENT= Dynamic DNS Support
|
||||
PLUGIN_MAINTAINER= franco@opnsense.org
|
||||
|
||||
|
||||
@@ -102,11 +102,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
|
||||
|
||||
if (isset($pconfig['host']) && in_array('host', $reqdfields)) {
|
||||
/* Namecheap can have a @. or *. in hostname */
|
||||
if ($pconfig['type'] == "namecheap" && (substr($pconfig['host'], 0, 2) == '@.' || substr($pconfig['host'], 0, 2) == '*.')) {
|
||||
$host_to_check = substr($pconfig['host'], 2);
|
||||
} else {
|
||||
$host_to_check = $pconfig['host'];
|
||||
$host_to_check = $pconfig['host'];
|
||||
|
||||
switch ($pconfig['type']) {
|
||||
case 'googledomains':
|
||||
case 'namecheap':
|
||||
$host_to_check = preg_replace('/^[@*]\./', '', $host_to_check);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!is_domain($host_to_check)) {
|
||||
|
||||
Reference in New Issue
Block a user