Commit e7652263 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(dns): Avoid showing root records when activating DNS on a new system

This disables DNS record filtering based on CN when the CN is empty.
This is the case when activating the DNS tab on a new system before
 filling the main tab.

close #5709
Showing with 1 addition and 1 deletion
+1 -1
...@@ -83,7 +83,7 @@ class DnsRecordsFilteredAttribute extends DnsRecordsAttribute ...@@ -83,7 +83,7 @@ class DnsRecordsFilteredAttribute extends DnsRecordsAttribute
} }
$ips = $this->plugin->parent->getBaseObject()->ipHostNumber; $ips = $this->plugin->parent->getBaseObject()->ipHostNumber;
$cn = preg_replace('/\$$/', '', $this->plugin->parent->getBaseObject()->cn); $cn = preg_replace('/\$$/', '', $this->plugin->parent->getBaseObject()->cn);
if (in_array($values[2], $ips) || ($values[0] == $cn) || preg_match('/'.preg_quote($cn.'.'.$this->getZoneName(), '/i').'/', $value[2])) { if (in_array($values[2], $ips) || (!empty($cn) && (($values[0] == $cn) || preg_match('/'.preg_quote($cn.'.'.$this->getZoneName(), '/i').'/', $value[2])))) {
return $values; return $values;
} else { } else {
return array(); return array();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment