Skip to content

Commit

Permalink
Don't export empty comments in bind9 format
Browse files Browse the repository at this point in the history
Also simplifies the code here to use the already existing
ResourceRecordSet->merge_comment_text() function.
  • Loading branch information
Thomas Pike committed Jul 5, 2017
1 parent ee7f27d commit 2a13147
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions model/zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,9 @@ public function export_as_bind9_format() {
$row .= str_pad(DNSTime::abbreviate($rrset->ttl), 6)." ";
$row .= str_pad($rrset->type, 6)." ";
$row .= str_pad(DNSContent::bind9_format($rr->content, $rrset->type, $this->name), 30);
$comments = $rrset->list_comments();
if(count($comments) > 0) {
$row .= " ; ";
$count = 0;
foreach($comments as $comment) {
$count++;
if($count > 1) $row .= " ";
$row .= $comment->content;
}
$comments = $rrset->merge_comment_text();
if($comments !== '') {
$row .= " ; $comments";
}
$output .= trim($row)."\n";
}
Expand Down

0 comments on commit 2a13147

Please sign in to comment.