From 0e2d01deebf0d9f22eab54da8d0bf699e17655e4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 20 Nov 2025 17:19:32 +0100 Subject: [PATCH 1/2] Pass option on to parent --- src/SOAP11/Utils/XPath.php | 6 ++++-- src/SOAP12/Utils/XPath.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SOAP11/Utils/XPath.php b/src/SOAP11/Utils/XPath.php index d8e7a8e..3fe5d3c 100644 --- a/src/SOAP11/Utils/XPath.php +++ b/src/SOAP11/Utils/XPath.php @@ -19,13 +19,15 @@ class XPath extends \SimpleSAML\XPath\XPath * Get a DOMXPath object that can be used to search for SAML elements. * * @param \DOMNode $node The document to associate to the DOMXPath object. + * @param bool $autoregister Whether to auto-register all namespaces used in the document * * @return \DOMXPath A DOMXPath object ready to use in the given document, with several * saml-related namespaces already registered. */ - public static function getXPath(DOMNode $node): DOMXPath + public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath { - $xp = parent::getXPath($node); + $xp = parent::getXPath($node, $autoregister); + $xp->registerNamespace('env11', C::NS_SOAP_ENV); $xp->registerNamespace('enc11', C::NS_SOAP_ENC); diff --git a/src/SOAP12/Utils/XPath.php b/src/SOAP12/Utils/XPath.php index b325338..42ab51c 100644 --- a/src/SOAP12/Utils/XPath.php +++ b/src/SOAP12/Utils/XPath.php @@ -19,13 +19,15 @@ class XPath extends \SimpleSAML\XPath\XPath * Get a DOMXPath object that can be used to search for SAML elements. * * @param \DOMNode $node The document to associate to the DOMXPath object. + * @param bool $autoregister Whether to auto-register all namespaces used in the document * * @return \DOMXPath A DOMXPath object ready to use in the given document, with several * saml-related namespaces already registered. */ - public static function getXPath(DOMNode $node): DOMXPath + public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath { - $xp = parent::getXPath($node); + $xp = parent::getXPath($node, $autoregister); + $xp->registerNamespace('env12', C::NS_SOAP_ENV); $xp->registerNamespace('enc12', C::NS_SOAP_ENC); From f481e1d7cc21d5f1a167c21ba094b6811d1ef936 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 20 Nov 2025 18:37:09 +0100 Subject: [PATCH 2/2] Bump xml-common --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d6571ae..7e81b24 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-pcre": "*", "simplesamlphp/assert": "~1.9", - "simplesamlphp/xml-common": "~2.1" + "simplesamlphp/xml-common": "~2.4" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "~1.10"