readd starting and ending quotes which got removed with the braces in #503

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-01-26 17:17:22 +01:00
parent 54d7b01ac5
commit 3fb92259a8

View File

@@ -52,18 +52,18 @@ class DnsEntry
if (substr($_l, 0, 1) == '"') { if (substr($_l, 0, 1) == '"') {
$_l = substr($_l, 1); $_l = substr($_l, 1);
} }
$_content = $_l . '"' . PHP_EOL; $_content = '"' . $_l . '"' . PHP_EOL;
$_l = array_pop($_contentlines); $_l = array_pop($_contentlines);
// check for ending quote // check for ending quote
if (substr($_l, -1) == '"') { if (substr($_l, - 1) == '"') {
$_l = substr($_l, 0, -1); $_l = substr($_l, 0, - 1);
} }
foreach ($_contentlines as $_cl) { foreach ($_contentlines as $_cl) {
// lines in between // lines in between
$_content .= "\t\t\t\t" . '"' . $_cl . '"' . PHP_EOL; $_content .= "\t\t\t\t" . '"' . $_cl . '"' . PHP_EOL;
} }
// last line // 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; $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; return $result;