summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dyndns_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-19 14:15:50 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-19 14:15:50 -0300
commitde29dadc20688daa579937fbd8b4dfdcae3587e6 (patch)
tree067b0fa099569c8bfe8e01eb04c48b27c8aeaf3f /usr/local/www/services_dyndns_edit.php
parent93ee78b7d83339476c1fd7b48ec201da72491c22 (diff)
downloadpfsense-de29dadc20688daa579937fbd8b4dfdcae3587e6.zip
pfsense-de29dadc20688daa579937fbd8b4dfdcae3587e6.tar.gz
Allow hostname to start with '@.' for namecheap. It fixes #3568
Diffstat (limited to 'usr/local/www/services_dyndns_edit.php')
-rw-r--r--usr/local/www/services_dyndns_edit.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php
index 0c3778b..620e06b 100644
--- a/usr/local/www/services_dyndns_edit.php
+++ b/usr/local/www/services_dyndns_edit.php
@@ -108,8 +108,18 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- if (($_POST['host'] && !is_domain($_POST['host'])))
- $input_errors[] = gettext("The Hostname contains invalid characters.");
+ if (isset($_POST['host'])) {
+ /* Namecheap can have a @. in hostname */
+ if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.')
+ $host_to_check = substr($_POST['host'], 2);
+ else
+ $host_to_check = $_POST['host'];
+
+ if (!is_domain($host_to_check))
+ $input_errors[] = gettext("The Hostname contains invalid characters.");
+
+ unset($host_to_check);
+ }
if (($_POST['mx'] && !is_domain($_POST['mx'])))
$input_errors[] = gettext("The MX contains invalid characters.");
if ((in_array("username", $reqdfields) && $_POST['username'] && !is_dyndns_username($_POST['username'])) || ((in_array("username", $reqdfields)) && ($_POST['username'] == "")))
OpenPOWER on IntegriCloud