Update WhoisService.php
This commit is contained in:
@@ -54,6 +54,27 @@ class WhoisService
|
|||||||
if ($rdapUrl) {
|
if ($rdapUrl) {
|
||||||
$rdapData = $this->queryRDAPGeneric($domain, $rdapUrl);
|
$rdapData = $this->queryRDAPGeneric($domain, $rdapUrl);
|
||||||
if ($rdapData) {
|
if ($rdapData) {
|
||||||
|
// If RDAP succeeded but is missing expiration date, try WHOIS as fallback
|
||||||
|
if (empty($rdapData['expiration_date']) && $whoisServer) {
|
||||||
|
$whoisData = $this->queryWhois($domain, $whoisServer);
|
||||||
|
if ($whoisData) {
|
||||||
|
// Check if we got a referral to another WHOIS server
|
||||||
|
$referralServer = $this->extractReferralServer($whoisData);
|
||||||
|
if ($referralServer && $referralServer !== $whoisServer) {
|
||||||
|
$whoisData = $this->queryWhois($domain, $referralServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($whoisData) {
|
||||||
|
// Parse WHOIS data to get expiration date
|
||||||
|
$whoisInfo = $this->parseWhoisData($domain, $whoisData, $referralServer ?? $whoisServer);
|
||||||
|
|
||||||
|
// Merge expiration date from WHOIS into RDAP data
|
||||||
|
if (!empty($whoisInfo['expiration_date'])) {
|
||||||
|
$rdapData['expiration_date'] = $whoisInfo['expiration_date'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return $rdapData;
|
return $rdapData;
|
||||||
}
|
}
|
||||||
// If RDAP failed, fall through to WHOIS
|
// If RDAP failed, fall through to WHOIS
|
||||||
@@ -696,6 +717,14 @@ class WhoisService
|
|||||||
return 'available';
|
return 'available';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If domain has "active" status but no expiration date, consider it active
|
||||||
|
// This handles TLDs like .nl that don't provide expiration dates
|
||||||
|
foreach ($statusArray as $status) {
|
||||||
|
if (stripos($status, 'active') !== false) {
|
||||||
|
return 'active';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$days = $this->daysUntilExpiration($expirationDate);
|
$days = $this->daysUntilExpiration($expirationDate);
|
||||||
|
|
||||||
if ($days === null) {
|
if ($days === null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user