summaryrefslogtreecommitdiffstats
path: root/lib/SAML2/Utils.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SAML2/Utils.php')
-rw-r--r--lib/SAML2/Utils.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/SAML2/Utils.php b/lib/SAML2/Utils.php
index d952434..0e37acc 100644
--- a/lib/SAML2/Utils.php
+++ b/lib/SAML2/Utils.php
@@ -458,15 +458,20 @@ class SAML2_Utils {
/**
* Extract strings from a set of nodes.
*
- * @param DOMElement $parent The element we should rund the XPath query on.
- * @param string $query The XPath query we should use to retrieve the nodes.
+ * @param DOMElement $parent The element that contains the localized strings.
+ * @param string $namespaceURI The namespace URI the string elements should have.
+ * @param string $localName The localName of the string elements.
* @return array The string values of the various nodes.
*/
- public static function extractStrings(DOMElement $parent, $query) {
- assert('is_string($query)');
+ public static function extractStrings(DOMElement $parent, $namespaceURI, $localName) {
+ assert('is_string($namespaceURI)');
+ assert('is_string($localName)');
$ret = array();
- foreach (self::xpQuery($parent, $query) as $node) {
+ for ($node = $parent->firstChild; $node !== NULL; $node = $node->nextSibling) {
+ if ($node->namespaceURI !== $namespaceURI || $node->localName !== $localName) {
+ continue;
+ }
$ret[] = trim($node->textContent);
}