Skip to content

Commit

Permalink
feat: find a domain with a non-ascii alphabet
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Aug 4, 2024
1 parent 6ebd034 commit 9d7076a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Controller/DomainRefreshController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public function __construct(private readonly DomainRepository $domainRepository,
*/
public function __invoke(string $ldhName, KernelInterface $kernel): ?Domain
{
$idnDomain = strtolower(idn_to_ascii($ldhName));

/** @var ?Domain $domain */
$domain = $this->domainRepository->findOneBy(['ldhName' => $ldhName]);
$domain = $this->domainRepository->findOneBy(['ldhName' => $idnDomain]);

// If the domain name exists in the database, recently updated and not important, we return the stored Domain
if (null !== $domain
Expand All @@ -55,7 +57,7 @@ public function __invoke(string $ldhName, KernelInterface $kernel): ?Domain
}

$updatedAt = null === $domain ? new \DateTimeImmutable('now') : $domain->getUpdatedAt();
$domain = $this->RDAPService->registerDomain($ldhName);
$domain = $this->RDAPService->registerDomain($idnDomain);

/** @var WatchList $watchList */
foreach ($domain->getWatchLists()->getIterator() as $watchList) {
Expand Down

0 comments on commit 9d7076a

Please sign in to comment.