File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace SimpleSAML \XMLSecurity ;
44
5+ use DOMXPath ;
6+ use Exception ;
7+
58/**
69 * xmlseclibs.php
710 *
4346
4447class XMLSecurityDSig extends \RobRichards \XMLSecLibs \XMLSecurityDSig
4548{
49+ /** @var DomXPath|null */
50+ private $ xPathCtx = null ;
51+
52+
4653 /**
4754 * @return bool
4855 * @throws Exception
@@ -77,4 +84,29 @@ public function validateReference()
7784 }
7885 return true ;
7986 }
87+
88+
89+ /**
90+ * Returns the XPathObj or null if xPathCtx is set and sigNode is empty.
91+ *
92+ * @return DOMXPath|null
93+ */
94+ private function getXPathObj ()
95+ {
96+ if (empty ($ this ->xPathCtx ) && ! empty ($ this ->sigNode )) {
97+ $ xpath = new DOMXPath ($ this ->sigNode ->ownerDocument );
98+ $ xpath ->registerNamespace ('secdsig ' , self ::XMLDSIGNS );
99+ $ this ->xPathCtx = $ xpath ;
100+ }
101+ return $ this ->xPathCtx ;
102+ }
103+
104+
105+ /**
106+ * Reset the XPathObj to null
107+ */
108+ private function resetXPathObj ()
109+ {
110+ $ this ->xPathCtx = null ;
111+ }
80112}
You can’t perform that action at this time.
0 commit comments