mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 10:15:41 +00:00
fix: convertToIdn static function
This commit is contained in:
parent
1bcebff59d
commit
38eac13b7a
@ -459,7 +459,7 @@ class WatchListController extends AbstractController
|
|||||||
|
|
||||||
foreach ($domains as $ldhName) {
|
foreach ($domains as $ldhName) {
|
||||||
/** @var ?Domain $domain */
|
/** @var ?Domain $domain */
|
||||||
$domain = $this->domainRepository->findOneBy(['ldhName' => $ldhName]);
|
$domain = $this->domainRepository->findOneBy(['ldhName' => RDAPService::convertToIdn($ldhName)]);
|
||||||
|
|
||||||
if (null === $domain) {
|
if (null === $domain) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use ApiPlatform\Metadata\Get;
|
|||||||
use App\Config\EventAction;
|
use App\Config\EventAction;
|
||||||
use App\Controller\DomainRefreshController;
|
use App\Controller\DomainRefreshController;
|
||||||
use App\Repository\DomainRepository;
|
use App\Repository\DomainRepository;
|
||||||
|
use App\Service\RDAPService;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
@ -152,7 +153,7 @@ class Domain
|
|||||||
|
|
||||||
public function setLdhName(string $ldhName): static
|
public function setLdhName(string $ldhName): static
|
||||||
{
|
{
|
||||||
$this->ldhName = strtolower($ldhName);
|
$this->ldhName = RDAPService::convertToIdn($ldhName);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ use ApiPlatform\Metadata\Get;
|
|||||||
use ApiPlatform\Metadata\GetCollection;
|
use ApiPlatform\Metadata\GetCollection;
|
||||||
use App\Config\TldType;
|
use App\Config\TldType;
|
||||||
use App\Repository\TldRepository;
|
use App\Repository\TldRepository;
|
||||||
|
use App\Service\RDAPService;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
@ -119,7 +120,7 @@ class Tld
|
|||||||
|
|
||||||
public function setTld(string $tld): static
|
public function setTld(string $tld): static
|
||||||
{
|
{
|
||||||
$this->tld = strtolower($tld);
|
$this->tld = RDAPService::convertToIdn($tld);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@ readonly class RDAPService
|
|||||||
*/
|
*/
|
||||||
public function registerDomain(string $fqdn): Domain
|
public function registerDomain(string $fqdn): Domain
|
||||||
{
|
{
|
||||||
$idnDomain = $this->convertToIdn($fqdn);
|
$idnDomain = RDAPService::convertToIdn($fqdn);
|
||||||
$tld = $this->getTld($idnDomain);
|
$tld = $this->getTld($idnDomain);
|
||||||
|
|
||||||
$this->logger->info('An update request for domain name {idnDomain} is requested.', [
|
$this->logger->info('An update request for domain name {idnDomain} is requested.', [
|
||||||
@ -198,7 +198,7 @@ readonly class RDAPService
|
|||||||
return $tldEntity;
|
return $tldEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function convertToIdn(string $fqdn): string
|
public static function convertToIdn(string $fqdn): string
|
||||||
{
|
{
|
||||||
return strtolower(idn_to_ascii($fqdn));
|
return strtolower(idn_to_ascii($fqdn));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user