This commit is contained in:
2018-03-25 11:30:04 +02:00
136 changed files with 17184 additions and 6944 deletions

View File

@@ -56,13 +56,29 @@ if ($action == 'add_record' && ! empty($_POST)) {
if (strpos($record, '--') !== false) {
$errors[] = $lng['error']['domain_nopunycode'];
} else {
// check for wildcard-record
$add_wildcard_again = false;
if (substr($record, 0, 2) == '*.') {
$record = substr($record, 2);
$add_wildcard_again = true;
}
// convert entry
$record = $idna_convert->encode($record);
if ($add_wildcard_again) {
$record = '*.'.$record;
}
/*
* see https://redmine.froxlor.org/issues/1697
*
if ($type != 'SRV' && $type != 'TXT' && $type != "CNAME" ) {
$check_dom = $record . '.example.com';
if (! validateDomain($check_dom)) {
$errors[] = sprintf($lng['error']['subdomainiswrong'], $idna_convert->decode($record));
}
}
*/
if (strlen($record) > 63) {
$errors[] = $lng['error']['dns_record_toolong'];
}
@@ -112,6 +128,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
if (substr($content, - 1) == '.') {
// remove it for checks
$content = substr($content, 0, - 1);
} else {
// add domain name
$content .= '.' . $domain;
}
if (! validateDomain($content)) {
$errors[] = $lng['error']['dns_cname_invaliddom'];
@@ -171,8 +190,8 @@ if ($action == 'add_record' && ! empty($_POST)) {
}
}
}
// append trailing dot (again)
if ($target != '.') {
// append trailing dot if there's none
if (substr($content, - 1) != '.') {
$content .= '.';
}
}