Skip to content

Commit

Permalink
fix: do not record event history if it is an IANA Registrar ID
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Dec 27, 2024
1 parent 149b208 commit 18d4299
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Service/RDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,12 @@ private function registerEntity(array $rdapEntity, array $roles, string $domain)
/*
* 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;
}
}
Expand Down Expand Up @@ -522,7 +524,7 @@ private function registerEntity(array $rdapEntity, array $roles, string $domain)
}
}

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;
}

Expand Down

0 comments on commit 18d4299

Please sign in to comment.