do not split dkim-entry content in generateDkimEntries(); re-add braces to enclose TXT record content

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-01-27 10:09:43 +01:00
parent 2603a9c869
commit f896fe11a0
2 changed files with 3 additions and 15 deletions

View File

@@ -52,7 +52,7 @@ class DnsEntry
if (substr($_l, 0, 1) == '"') {
$_l = substr($_l, 1);
}
$_content = '"' . $_l . '"' . PHP_EOL;
$_content = '("' . $_l . '"' . PHP_EOL;
$_l = array_pop($_contentlines);
// check for ending quote
if (substr($_l, - 1) == '"') {
@@ -63,7 +63,7 @@ class DnsEntry
$_content .= "\t\t\t\t" . '"' . $_cl . '"' . PHP_EOL;
}
// last line
$_content .= "\t\t\t\t" . '"' . $_l . '"';
$_content .= "\t\t\t\t" . '"' . $_l . '")';
}
$result = $this->record . "\t" . $this->ttl . "\t" . $this->class . "\t" . $this->type . "\t" . (($this->priority >= 0 && ($this->type == 'MX' || $this->type == 'SRV')) ? $this->priority . "\t" : "") . $_content . PHP_EOL;
return $result;

View File

@@ -54,20 +54,8 @@ function generateDkimEntries($domain)
// end-part
$dkim_txt .= 't=s';
if (Settings::Get('system.dns_server') == 'pdns') {
// PowerDNS does not need/want splitted content
$txt_record_split = $dkim_txt;
} else {
// split if necessary
$txt_record_split = '';
$lbr = 50;
for ($pos = 0; $pos <= strlen($dkim_txt) - 1; $pos += $lbr) {
$txt_record_split .= (($pos == 0) ? '("' : "\t\t\t\t\t \"") . substr($dkim_txt, $pos, $lbr) . (($pos >= strlen($dkim_txt) - $lbr) ? '")' : '"') . "\n";
}
}
// dkim-entry
$zone_dkim[] = $txt_record_split;
$zone_dkim[] = $dkim_txt;
// adsp-entry
if (Settings::Get('dkim.dkim_add_adsp') == "1") {