Skip to content

Commit 11a1c44

Browse files
authored
Pass option on to parent (#395)
1 parent 6522c9a commit 11a1c44

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/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\XMLSecurity\Utils\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('saml_protocol', C::NS_SAMLP);
3032
$xp->registerNamespace('saml_assertion', C::NS_SAML);
3133
$xp->registerNamespace('saml_metadata', C::NS_MD);

0 commit comments

Comments
 (0)