diff --git a/functions.php b/functions.php index bf46ea319..d69cd2bd2 100644 --- a/functions.php +++ b/functions.php @@ -373,10 +373,11 @@ function encryptLoginEntry($login_password_cleartext) // Get domain expiration date function getDomainExpirationDate($name) { - + $nullValue = "1970-01-01"; + // Only run if we think the domain is valid if (!filter_var($name, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) { - return "NULL"; + return $nullValue; } $ch = curl_init(); @@ -390,14 +391,14 @@ function getDomainExpirationDate($name) } elseif (isset($response['expiration_date'])) { $expiry = new DateTime($response['expiration_date']); } else { - return "NULL"; + return $nullValue; } - + return $expiry->format('Y-m-d'); } // Default return - return "NULL"; + return $nullValue; } // Get domain general info (whois + NS/A/MX records)