From 867b7b139067f051e0b2498fa82fde510cb9c07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurice=20Preu=C3=9F=20=28envoyr=29?= Date: Wed, 18 Jan 2023 14:47:25 +0100 Subject: [PATCH] fix domain variable for gethostbynamel6 function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurice Preuß (envoyr) --- lib/Froxlor/Api/Commands/Domains.php | 2 +- lib/Froxlor/Api/Commands/SubDomains.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/Api/Commands/Domains.php b/lib/Froxlor/Api/Commands/Domains.php index 93d853f4c8..cbf85fef1c 100644 --- a/lib/Froxlor/Api/Commands/Domains.php +++ b/lib/Froxlor/Api/Commands/Domains.php @@ -1523,7 +1523,7 @@ public function update() // validate dns if lets encrypt is enabled to check whether we can use it at all if ($letsencrypt == '1' && Settings::Get('system.le_domain_dnscheck') == '1') { - $domain_ips = PhpHelper::gethostbynamel6($domain, true, Settings::Get('system.le_domain_dnscheck_resolver')); + $domain_ips = PhpHelper::gethostbynamel6($result['domain'], true, Settings::Get('system.le_domain_dnscheck_resolver')); $selected_ips = $this->getIpsFromIdArray($ssl_ipandports); if ($domain_ips == false || count(array_intersect($selected_ips, $domain_ips)) <= 0) { Response::standardError('invaliddnsforletsencrypt', '', true); diff --git a/lib/Froxlor/Api/Commands/SubDomains.php b/lib/Froxlor/Api/Commands/SubDomains.php index 6389650d3e..98c05cb95f 100644 --- a/lib/Froxlor/Api/Commands/SubDomains.php +++ b/lib/Froxlor/Api/Commands/SubDomains.php @@ -262,7 +262,7 @@ public function add() // validate dns if lets encrypt is enabled to check whether we can use it at all if ($letsencrypt == '1' && Settings::Get('system.le_domain_dnscheck') == '1') { $our_ips = Domain::getIpsOfDomain($domain_check['id']); - $domain_ips = PhpHelper::gethostbynamel6($domain, true, Settings::Get('system.le_domain_dnscheck_resolver')); + $domain_ips = PhpHelper::gethostbynamel6($completedomain, true, Settings::Get('system.le_domain_dnscheck_resolver')); if ($domain_ips == false || count(array_intersect($our_ips, $domain_ips)) <= 0) { Response::standardError('invaliddnsforletsencrypt', '', true); } @@ -738,7 +738,7 @@ public function update() // validate dns if lets encrypt is enabled to check whether we can use it at all if ($result['letsencrypt'] != $letsencrypt && $letsencrypt == '1' && Settings::Get('system.le_domain_dnscheck') == '1') { $our_ips = Domain::getIpsOfDomain($result['parentdomainid']); - $domain_ips = PhpHelper::gethostbynamel6($domain, true, Settings::Get('system.le_domain_dnscheck_resolver')); + $domain_ips = PhpHelper::gethostbynamel6($result['domain'], true, Settings::Get('system.le_domain_dnscheck_resolver')); if ($domain_ips == false || count(array_intersect($our_ips, $domain_ips)) <= 0) { Response::standardError('invaliddnsforletsencrypt', '', true); }