From 2c5f242a53ac729a55fd52a60961abc1213838a0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 27 May 2026 11:36:20 +0200 Subject: [PATCH 1/2] Fix use of incorrect property --- src/XPath/XPath.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XPath/XPath.php b/src/XPath/XPath.php index d1b4575f..8a664356 100644 --- a/src/XPath/XPath.php +++ b/src/XPath/XPath.php @@ -124,7 +124,7 @@ private static function registerAncestorNamespaces(DOMXPath $xp, DOMNode $node): if ($attr->namespaceURI !== C_XML::NS_XMLNS) { continue; } - $prefix = $attr->localName; + $prefix = $attr->prefix; $uri = (string) $attr->nodeValue; if ( From 4053cea86d1a332d4150edef68ced8d59ac95990 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 27 May 2026 11:40:26 +0200 Subject: [PATCH 2/2] Prefix cannot be null --- src/XPath/XPath.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/XPath/XPath.php b/src/XPath/XPath.php index 8a664356..0f22ad55 100644 --- a/src/XPath/XPath.php +++ b/src/XPath/XPath.php @@ -128,9 +128,7 @@ private static function registerAncestorNamespaces(DOMXPath $xp, DOMNode $node): $uri = (string) $attr->nodeValue; if ( - $prefix === null || $prefix === '' || - $prefix === 'xmlns' || $uri === '' || - isset($prefixToUri[$prefix]) + $prefix === '' || $prefix === 'xmlns' || $uri === '' || isset($prefixToUri[$prefix]) ) { continue; }