Skip to content
Snippets Groups Projects
Commit 712ea722 authored by Olav Morken's avatar Olav Morken
Browse files

SimpleSAML_Utilities: Handle comment nodes in isDOMElementOfType.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1734 44740490-163a-0410-bde0-09ae8108e29a
parent 62b46cf2
Branches
Tags
No related merge requests found
......@@ -792,12 +792,16 @@ class SimpleSAML_Utilities {
* @param $nsURI The namespaceURI the element should have.
* @return TRUE if both namespace and localname matches, FALSE otherwise.
*/
public static function isDOMElementOfType($element, $name, $nsURI) {
assert('$element instanceof DOMElement');
public static function isDOMElementOfType(DOMNode $element, $name, $nsURI) {
assert('is_string($name)');
assert('is_string($nsURI)');
assert('strlen($nsURI) > 0');
if (!($element instanceof DOMElement)) {
/* Most likely a comment-node. */
return FALSE;
}
/* Check if the namespace is a shortcut, and expand it if it is. */
if($nsURI[0] == '@') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment