fix: do not record event history if it is an IANA Registrar ID

This commit is contained in:
Maël Gangloff 2024-12-27 18:21:07 +01:00
parent 149b208399
commit 18d42993e3
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629

View File

@ -473,10 +473,12 @@ readonly class RDAPService
/*
* If the RDAP server transmits the entity's IANA number, it is used as a priority to identify the entity
*/
$isIANAid = false;
if (array_key_exists('publicIds', $rdapEntity)) {
foreach ($rdapEntity['publicIds'] as $publicId) {
if ('IANA Registrar ID' === $publicId['type'] && array_key_exists('identifier', $publicId)) {
$rdapEntity['handle'] = $publicId['identifier'];
$isIANAid = true;
break;
}
}
@ -522,7 +524,7 @@ readonly class RDAPService
}
}
if (!array_key_exists('events', $rdapEntity) || in_array($rdapEntity['handle'], self::ENTITY_IANA_RESERVED_IDS)) {
if ($isIANAid || !array_key_exists('events', $rdapEntity) || in_array($rdapEntity['handle'], self::ENTITY_IANA_RESERVED_IDS)) {
return $entity;
}