From 09f3bfd8f45e3a1cd0bec72a56347340f5930d4d Mon Sep 17 00:00:00 2001 From: wrongecho Date: Thu, 6 Nov 2025 11:57:08 +0000 Subject: [PATCH] When fetching domain records, quit if no SOA record exists (prevents most sub-domains) --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index f05bf93d..bffe1f8c 100644 --- a/functions.php +++ b/functions.php @@ -520,7 +520,7 @@ function getDomainRecords($name) $records = array(); // Only run if we think the domain is valid - if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) { + if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) || !checkdnsrr($name, 'SOA')) { $records['a'] = ''; $records['ns'] = ''; $records['mx'] = ''; @@ -1292,7 +1292,7 @@ function fetchUpdates() { function getDomainExpirationDate($domain) { // Execute the whois command $result = shell_exec("whois " . escapeshellarg($domain)); - if (!$result) { + if (!$result || !checkdnsrr($domain, 'SOA')) { return null; // Return null if WHOIS query fails }