From 8d381200ca6d55b3449ae45e97db70fefa9ba151 Mon Sep 17 00:00:00 2001 From: mrflos Date: Fri, 21 Apr 2023 08:57:51 +0300 Subject: [PATCH] fix(yeswiki-installer) : better subdomain test --- yeswiki-installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yeswiki-installer.php b/yeswiki-installer.php index b42367b..0996366 100755 --- a/yeswiki-installer.php +++ b/yeswiki-installer.php @@ -80,7 +80,9 @@ if (0 == posix_getuid()) { $noip6 = $climate->arguments->get('noip6'); $herseUser = $climate->arguments->get('herseuser'); $hersePass = $climate->arguments->get('hersepass'); - $isFullDomain = !preg_match('/.'.$_SERVER['maindomain'].'$/isU', $domain, $matches, PREG_OFFSET_CAPTURE, 0); + + //$isFullDomain = !preg_match('/.'.$_SERVER['maindomain'].'$/isU', $domain, $matches, PREG_OFFSET_CAPTURE, 0); + $isFullDomain = !preg_match('/^([a-zA-Z0-9]([-a-zA-Z0-9]{0,61}[a-zA-Z0-9])\.)([a-zA-Z0-9]{1,2}([-a-zA-Z0-9]{0,252}[a-zA-Z0-9])?)\.([a-zA-Z]{2,63})$/isU', $domain, $matches, PREG_OFFSET_CAPTURE, 0); if (!$nossl) { checkDNS($domain, $isFullDomain, $noip6); }