no quotation of dns data for powerdns

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-05-21 09:03:21 +02:00
parent 7ea1de2a92
commit 339d84736e
2 changed files with 20 additions and 7 deletions

View File

@@ -292,7 +292,7 @@ function addRequiredEntry($record = '@', $type = 'A', &$required)
function encloseTXTContent($txt_content, $isMultiLine = false)
{
// check that TXT content is enclosed in " "
if ($isMultiLine == false) {
if ($isMultiLine == false && Settings::Get('system.dns_server') != 'pdns') {
if (substr($txt_content, 0, 1) != '"') {
$txt_content = '"' . $txt_content;
}
@@ -300,6 +300,15 @@ function encloseTXTContent($txt_content, $isMultiLine = false)
$txt_content .= '"';
}
}
if (Settings::Get('system.dns_server') == 'pdns') {
// no quotation for PowerDNS
if (substr($txt_content, 0, 1) == '"') {
$txt_content = substr($txt_content, 1);
}
if (substr($txt_content, - 1) == '"') {
$txt_content = substr($txt_content, 0, -1);
}
}
return $txt_content;
}