From fa77e0c4b57dd7b3364c5913a41ad96d4fa91435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Mon, 11 Aug 2025 00:39:44 +0200 Subject: [PATCH] fix: UZ registry vcardArray value --- src/Service/RDAPService.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 189c4c2..eb98465 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -545,11 +545,30 @@ readonly class RDAPService if (isset($rdapEntity['vcardArray']) && !in_array($rdapEntity['handle'], self::IANA_RESERVED_IDS)) { if (empty($entity->getJCard())) { - $entity->setJCard($rdapEntity['vcardArray']); + if (!array_key_exists('elements', $rdapEntity['vcardArray'])) { + $entity->setJCard($rdapEntity['vcardArray']); + } else { + /* + * UZ registry + */ + $entity->setJCard([ + 'vcard', + $rdapEntity['vcardArray']['elements'], + ]); + } } else { $properties = []; - foreach ($rdapEntity['vcardArray'][1] as $prop) { - $properties[$prop[0]] = $prop; + if (!array_key_exists('elements', $rdapEntity['vcardArray'])) { + foreach ($rdapEntity['vcardArray'][1] as $prop) { + $properties[$prop[0]] = $prop; + } + } else { + /* + * UZ registry + */ + foreach ($rdapEntity['vcardArray']['elements'] as $prop) { + $properties[$prop[0]] = $prop; + } } foreach ($entity->getJCard()[1] as $prop) { $properties[$prop[0]] = $prop;