Added fix for updating apex domains (mydomain.com) with gratisdns (#1806)

This commit is contained in:
Fredrik Rambris
2021-02-03 10:32:15 +01:00
committed by GitHub
parent 20090ccdb9
commit a971e25370
@@ -883,7 +883,12 @@ class updatedns
case 'gratisdns':
$server = "https://admin.gratisdns.com/ddns.php";
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
list($hostname, $domain) = explode(".", $this->_dnsHost, 2);
if(substr_count($this->_dnsHost, ".") < 2) {
$domain = $this->_dnsHost;
$hostname = $this->_dnsHost;
} else {
list($hostname, $domain) = explode(".", $this->_dnsHost, 2);
}
curl_setopt($ch, CURLOPT_URL, $server . '?u=' . urlencode($this->_dnsUser) . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain . '&i=' . $this->_dnsIP);
break;
case 'ovh-dynhost':