Revision: 1734
Author: olavmrk
Date: Tue Sep 1 03:59:16 2009
Log: SimpleSAML_Utilities: Handle comment nodes in isDOMElementOfType.
http://code.google.com/p/simplesamlphp/source/detail?r=1734
Modified:
/trunk/lib/SimpleSAML/Utilities.php
=======================================
--- /trunk/lib/SimpleSAML/Utilities.php Fri Aug 28 00:47:12 2009
+++ /trunk/lib/SimpleSAML/Utilities.php Tue Sep 1 03:59:16 2009
@@ -792,12 +792,16 @@
* @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] == '@') {
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simplesamlphp-commits?hl=en
-~----------~----~----~----~------~----~------~--~---