Skip to content

Commit addc652

Browse files
committed
Fixed Wrong DNS Validation #6357
1 parent 5bbec2b commit addc652

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

interface/web/dns/dns_edit_base.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
class dns_page_action extends tform_actions {
4242

4343
protected function checkDuplicate() {
44+
global $app;
45+
// If a CNAME RR is present at a node, no other data should be present
46+
$tmp = $app->db->queryOneRecord("SELECT count(dns_rr.id) as number FROM dns_rr LEFT JOIN dns_soa ON dns_rr.zone = dns_soa.id WHERE (type = 'CNAME' AND ( name = SUBSTRING_INDEX(?, ".", 1) or name = ? or name = concat(?,".",dns_soa.origin) ) AND zone = ? and id != ?)", $this->dataRecord["name"], $this->dataRecord["name"], $this->dataRecord["name"], $this->dataRecord["zone"], $this->id);
47+
if($tmp['number'] > 0) return true;
4448
return false;
4549
}
4650

0 commit comments

Comments
 (0)