From 61222ece7c0f723832383a67531c0fd3cc0933e2 Mon Sep 17 00:00:00 2001 From: Hosteroid Date: Tue, 21 Oct 2025 15:05:33 +0300 Subject: [PATCH] Update WhoisService.php --- app/Services/WhoisService.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Services/WhoisService.php b/app/Services/WhoisService.php index a0880e8..7f2219d 100644 --- a/app/Services/WhoisService.php +++ b/app/Services/WhoisService.php @@ -55,7 +55,18 @@ class WhoisService $rdapData = $this->queryRDAPGeneric($domain, $rdapUrl); if ($rdapData) { // If RDAP succeeded but is missing expiration date, try WHOIS as fallback - if (empty($rdapData['expiration_date']) && $whoisServer) { + // But only if the domain is not already marked as available + $isAvailable = false; + if (isset($rdapData['status']) && is_array($rdapData['status'])) { + foreach ($rdapData['status'] as $status) { + if (stripos($status, 'AVAILABLE') !== false) { + $isAvailable = true; + break; + } + } + } + + if (empty($rdapData['expiration_date']) && !$isAvailable && $whoisServer) { $whoisData = $this->queryWhois($domain, $whoisServer); if ($whoisData) { // Check if we got a referral to another WHOIS server