Skip to content

Commit 0e2d01d

Browse files
committed
Pass option on to parent
1 parent 77bd4ee commit 0e2d01d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/SOAP11/Utils/XPath.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ class XPath extends \SimpleSAML\XPath\XPath
1919
* Get a DOMXPath object that can be used to search for SAML elements.
2020
*
2121
* @param \DOMNode $node The document to associate to the DOMXPath object.
22+
* @param bool $autoregister Whether to auto-register all namespaces used in the document
2223
*
2324
* @return \DOMXPath A DOMXPath object ready to use in the given document, with several
2425
* saml-related namespaces already registered.
2526
*/
26-
public static function getXPath(DOMNode $node): DOMXPath
27+
public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath
2728
{
28-
$xp = parent::getXPath($node);
29+
$xp = parent::getXPath($node, $autoregister);
30+
2931
$xp->registerNamespace('env11', C::NS_SOAP_ENV);
3032
$xp->registerNamespace('enc11', C::NS_SOAP_ENC);
3133

src/SOAP12/Utils/XPath.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ class XPath extends \SimpleSAML\XPath\XPath
1919
* Get a DOMXPath object that can be used to search for SAML elements.
2020
*
2121
* @param \DOMNode $node The document to associate to the DOMXPath object.
22+
* @param bool $autoregister Whether to auto-register all namespaces used in the document
2223
*
2324
* @return \DOMXPath A DOMXPath object ready to use in the given document, with several
2425
* saml-related namespaces already registered.
2526
*/
26-
public static function getXPath(DOMNode $node): DOMXPath
27+
public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath
2728
{
28-
$xp = parent::getXPath($node);
29+
$xp = parent::getXPath($node, $autoregister);
30+
2931
$xp->registerNamespace('env12', C::NS_SOAP_ENV);
3032
$xp->registerNamespace('enc12', C::NS_SOAP_ENC);
3133

0 commit comments

Comments
 (0)