fix wildcard entries in dns editor, fixes #447; do not add extra dot at the end of SRV entries, fixes #446

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p) 2017-06-04 09:31:55 +02:00
parent a3201481f6
commit 332e627007

View File

@ -56,7 +56,19 @@ 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
*
@ -175,8 +187,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 .= '.';
}
}