From b56affe66d236638a248c65719c5b114f3aacbf7 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 19 Jun 2018 14:47:00 +0200 Subject: [PATCH 1/2] fixed labels parsing for escaped dot sequences --- src/Records/Types/DomainName.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Records/Types/DomainName.php b/src/Records/Types/DomainName.php index 5247c27..b01b6c5 100644 --- a/src/Records/Types/DomainName.php +++ b/src/Records/Types/DomainName.php @@ -57,7 +57,24 @@ public function __construct($value = null) */ public function setValue($value) { - $this->setLabels(\explode('.', (string)$value)); + + $labels = preg_split( + '~(? '.', + ] + ); + }, + $labels + ); + + $this->setLabels($labels); } /** From ec32d84a8071705c61bb901675af23b4b2a88e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Podsedn=C3=ADk?= Date: Thu, 3 Feb 2022 14:12:39 +0100 Subject: [PATCH 2/2] fixed split txt record handling --- src/Records/TypeDefinitions/TypeDefinitionManager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Records/TypeDefinitions/TypeDefinitionManager.php b/src/Records/TypeDefinitions/TypeDefinitionManager.php index be4da0a..ef0df47 100644 --- a/src/Records/TypeDefinitions/TypeDefinitionManager.php +++ b/src/Records/TypeDefinitions/TypeDefinitionManager.php @@ -226,6 +226,7 @@ private function setDefinitions() ], ResourceTypes::TXT => [ // RFC 1035 'txtdata+' => Types::CHARACTER_STRING, + '__toString' => static function() { return \implode('', \func_get_args()); }, ], ResourceTypes::WKS => [ // RFC 1035 'address' => Types::IPV4_ADDRESS,