diff --git a/rdap/start_rdap.php b/rdap/start_rdap.php index bddd3f6..c8e2efd 100644 --- a/rdap/start_rdap.php +++ b/rdap/start_rdap.php @@ -148,6 +148,7 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) { // Extract TLD from the domain $parts = explode('.', $domain); + $domainName = $parts[0]; $tld = "." . end($parts); // Check if the TLD exists in the service_domain table @@ -171,7 +172,8 @@ function handleDomainQuery($request, $response, $pdo, $domainName, $c, $log) { DATE_FORMAT(`updated_at`, '%Y-%m-%dT%H:%i:%sZ') AS `update`, DATE_FORMAT(`expires_at`, '%Y-%m-%dT%H:%i:%sZ') AS `exdate` FROM service_domain WHERE sld = :domain AND tld = :tld"); - $stmt1->bindParam(':domain', $domain, PDO::PARAM_STR); + $stmt1->bindParam(':domain', $domainName, PDO::PARAM_STR); + $stmt1->bindParam(':tld', $tld, PDO::PARAM_STR); $stmt1->execute(); $domainDetails = $stmt1->fetch(PDO::FETCH_ASSOC); diff --git a/whois/port43/start_whois.php b/whois/port43/start_whois.php index 19b4c54..134d515 100644 --- a/whois/port43/start_whois.php +++ b/whois/port43/start_whois.php @@ -109,6 +109,7 @@ // Extract TLD from the domain and prepend a dot $parts = explode('.', $domain); + $domainName = $parts[0]; $tld = "." . end($parts); // Check if the TLD exists in the service_domain table