diff --git a/config/app/custom_rdap_servers.example.yaml b/config/app/custom_rdap_servers.example.yaml index 7688aaf..4f9b11f 100644 --- a/config/app/custom_rdap_servers.example.yaml +++ b/config/app/custom_rdap_servers.example.yaml @@ -28,6 +28,7 @@ [ [ "ag", + "ac", "me", "bz", "gi", diff --git a/src/Entity/Domain.php b/src/Entity/Domain.php index 8558d80..138f304 100644 --- a/src/Entity/Domain.php +++ b/src/Entity/Domain.php @@ -476,13 +476,16 @@ class Domain return in_array('pending delete', $this->getStatus()) && !in_array('redemption period', $this->getStatus()); } + /** + * @throws \DateMalformedIntervalStringException + */ private function calculateDaysFromStatus($lastStatus, \DateTimeImmutable $now): ?int { if (in_array('pending delete', $lastStatus->getAddStatus()) && !$this->isRedemptionPeriod()) { - return self::daysBetween($now, $lastStatus->getCreatedAt()->add(new \DateInterval('P5D'))); + return self::daysBetween($now, $lastStatus->getCreatedAt()->add(new \DateInterval('P'. 6 .'D'))); } if (in_array('redemption period', $lastStatus->getAddStatus())) { - return self::daysBetween($now, $lastStatus->getCreatedAt()->add(new \DateInterval('P35D'))); + return self::daysBetween($now, $lastStatus->getCreatedAt()->add(new \DateInterval('P'.(30 + 6).'D'))); } return null; @@ -532,17 +535,18 @@ class Domain [$expiredAt, $deletedAt] = $this->getRelevantDates(); if ($deletedAt) { + // It has been observed that AFNIC, on the last day, adds a "deleted" event and removes the redemption period status. if (0 === self::daysBetween($now, $deletedAt) && in_array('pending delete', $this->getStatus())) { return 0; } - $guess = self::daysBetween($now, $deletedAt->add(new \DateInterval('P30D'))); + $guess = self::daysBetween($now, $deletedAt->add(new \DateInterval('P'. 30 .'D'))); return self::returnExpiresIn($guess, $daysToExpiration ?? $guess); } if ($expiredAt) { - $guess = self::daysBetween($now, $expiredAt->add(new \DateInterval('P'.(45 + 30 + 5).'D'))); + $guess = self::daysBetween($now, $expiredAt->add(new \DateInterval('P'.(45 + 30 + 6).'D'))); return self::returnExpiresIn($guess, $daysToExpiration ?? $guess); }