summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-03-06 12:45:46 -0500
committerjim-p <jimp@pfsense.org>2017-03-06 12:47:08 -0500
commita3d6987ecd0f413af18e52b8ee731dbdbc64fa22 (patch)
tree274d77f9bdd8212ff67b2fa72d2f90dcb218252e
parenta1518c967b6080382e42195ab99279f5086f07b0 (diff)
downloadpfsense-a3d6987ecd0f413af18e52b8ee731dbdbc64fa22.zip
pfsense-a3d6987ecd0f413af18e52b8ee731dbdbc64fa22.tar.gz
Allow CloudFlare DDNS entries to use "@" or "@." for the hostname portion of the domain in the GUI to update the domain's @ record. Then in the backend code, remove that from the FQDN since CloudFlare doesn't like that to be sent explicitly. Fixes #7357
Fix is confirmed to work by two forum users: https://forum.pfsense.org/index.php?topic=122099.msg699763#msg699763
-rw-r--r--src/etc/inc/dyndns.class1
-rw-r--r--src/usr/local/www/services_dyndns_edit.php2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class
index ddbea57..76d8739 100644
--- a/src/etc/inc/dyndns.class
+++ b/src/etc/inc/dyndns.class
@@ -720,6 +720,7 @@
break;
case 'cloudflare-v6':
case 'cloudflare':
+ $this->_FQDN = ltrim($this->_FQDN, '@.');
$isv6 = ($this->_dnsService === 'cloudflare-v6');
$recordType = $isv6 ? "AAAA" : "A";
$needsIP = TRUE;
diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
index b0f58ac..9abebfe 100644
--- a/src/usr/local/www/services_dyndns_edit.php
+++ b/src/usr/local/www/services_dyndns_edit.php
@@ -149,6 +149,8 @@ if ($_POST) {
/* Namecheap can have a @. and *. in hostname */
if ($pconfig['type'] == "namecheap" && ($_POST['host'] == '*.' || $_POST['host'] == '*' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
$host_to_check = $_POST['domainname'];
+ } elseif ((($pconfig['type'] == "cloudflare") || ($pconfig['type'] == "cloudflare-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
+ $host_to_check = $_POST['domainname'];
} else {
$host_to_check = $_POST['host'];
OpenPOWER on IntegriCloud