Fixed Color Logic

This commit is contained in:
2026-02-12 21:33:15 +00:00
parent 4864cd6a3e
commit ccc0720cfc
4 changed files with 47 additions and 11 deletions

View File

@@ -7,6 +7,22 @@ $timeout = 10; // timeout secondi per connessioni
// --- Helpers ---
// Estrae hostname da domain (rimuove eventuali schema/port/path)
function ssl_days_left($expiry_date) {
if (empty($expiry_date)) return null;
$expiry = DateTime::createFromFormat('d/m/Y', $expiry_date);
if (!$expiry) return null;
$now = new DateTime();
$interval = $now->diff($expiry);
$days = (int)$interval->format('%r%a'); // giorni con segno
return $days;
}
function normalizeDomainHost(string $domain): string {
// rimuovi schema se presente
if (preg_match('#^https?://#i', $domain)) {