From 3e905f9d6b8894febb2bacb9757a7d09e1cc7903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 12 Sep 2025 14:48:56 +0200 Subject: [PATCH] AI review fixes --- .env | 2 +- src/Appwrite/Network/Validator/DNS.php | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.env b/.env index 28d1799a59..666e1bb92e 100644 --- a/.env +++ b/.env @@ -21,7 +21,7 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled _APP_OPENSSL_KEY_V1=your-secret-key -_APP_DNS=8.8.8.8,1.1.1.1 +_APP_DNS=8.8.8.8,1.1.1.1 _APP_DOMAIN=traefik _APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost diff --git a/src/Appwrite/Network/Validator/DNS.php b/src/Appwrite/Network/Validator/DNS.php index af8b064689..cc30ec2246 100644 --- a/src/Appwrite/Network/Validator/DNS.php +++ b/src/Appwrite/Network/Validator/DNS.php @@ -18,17 +18,15 @@ class DNS extends Validator protected const FAILURE_REASON_INTERNAL = 'Internal error occurred.'; protected const FAILURE_REASON_UNKNOWN = ''; - protected static string $regionVerbose = ''; // Useful when overriding in multi-region environments - /** * @var mixed */ - protected mixed $logs; + protected mixed $logs = []; /** * @var array */ - protected array $dnsServers; + protected array $dnsServers = []; protected string $domain = ''; protected string $resolver = ''; @@ -61,13 +59,7 @@ class DNS extends Validator $messages = []; - $region = self::$regionVerbose; - - if (!empty($region)) { - $messages[] = "Verification of DNS records failed with DNS resolver {$this->resolver} in {$region} region"; - } else { - $messages[] = "Verification of DNS records failed with DNS resolver {$this->resolver}"; - } + $messages[] = "Verification of DNS records failed with DNS resolver {$this->resolver}"; if ($this->count === 0) { $messages[] = 'Domain ' . $this->domain . ' does not have ' . $this->type . ' record'; @@ -169,7 +161,7 @@ class DNS extends Validator \array_shift($parts); $parentDomain = \implode('.', $parts); $validator = new DNS($this->target, DNS::RECORD_CAA, $dnsServer); - return $validator->isValid($parentDomain, $dnsServer); + return $validator->isValidWithDNSServer($parentDomain, $dnsServer); } return false;