From 1955d826405e6be0e5299d2ea4a369aa9437a12b Mon Sep 17 00:00:00 2001 From: Demian Date: Thu, 9 Feb 2023 15:48:21 +0100 Subject: [PATCH] fix checkDomainModuleDomain call on dns zone imports #6345 before we handed over domain_name instead of domain_id to the checkDomainModuleDomain function, which resulted in nothing. This fixes the call by querying the database for the domain_id for the given domain_name. --- interface/web/dns/dns_import.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/web/dns/dns_import.php b/interface/web/dns/dns_import.php index b0c19bfff0..711e237db1 100644 --- a/interface/web/dns/dns_import.php +++ b/interface/web/dns/dns_import.php @@ -622,7 +622,11 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name' $error[] = $wb['zone_file_soa_parser']; $error[] = print_r( $soa, true ); } - if ($settings['use_domain_module'] == 'y' && ! $app->tools_sites->checkDomainModuleDomain($soa['name']) ) { + + $tmp_soa_name = trim($soa['name'], "."); + $tmp_domain_id = $app->db->queryOneRecord('SELECT domain_id FROM domain where domain = ?', $tmp_soa_name); + + if ($settings['use_domain_module'] == 'y' && ! $app->tools_sites->checkDomainModuleDomain($tmp_domain_id['domain_id']) ) { $valid_zone_file = false; $error[] = $wb['zone_not_allowed']; } -- GitLab