From 9d7076a76bfd496b5318e5875ae103a598c13a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Sun, 4 Aug 2024 13:22:31 +0200 Subject: [PATCH] feat: find a domain with a non-ascii alphabet --- src/Controller/DomainRefreshController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Controller/DomainRefreshController.php b/src/Controller/DomainRefreshController.php index 6fc54fa..7105fa9 100644 --- a/src/Controller/DomainRefreshController.php +++ b/src/Controller/DomainRefreshController.php @@ -35,8 +35,10 @@ class DomainRefreshController extends AbstractController */ 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 @@ -55,7 +57,7 @@ class DomainRefreshController extends AbstractController } $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) {