From db6ed9771197ec5053faa6262f282d2f784ad76e Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 13 Mar 2013 07:07:35 +0000
Subject: [PATCH] SAMLParser: Fix incorrect assertion & documentation in
 parseElement().
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The parseElement()-function actually accepts a
SAML2_XML_md_EntityDescriptor object, not a DOMElement.

Thanks to François Kooman for reporting this bug and supplying a patch!

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3228 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Metadata/SAMLParser.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 815b24ff3..913877a85 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -223,13 +223,13 @@ class SimpleSAML_Metadata_SAMLParser {
 
 
 	/**
-	 * This function parses a DOMElement which represents a EntityDescriptor element.
+	 * This function parses a SAML2_XML_md_EntityDescriptor object which represents a EntityDescriptor element.
 	 *
-	 * @param $entityElement  A DOMElement which represents a EntityDescriptor element.
+	 * @param $entityElement  A SAML2_XML_md_EntityDescriptor object which represents a EntityDescriptor element.
 	 * @return An instance of this class with the metadata loaded.
 	 */
 	public static function parseElement($entityElement) {
-		assert('$entityElement instanceof DOMElement');
+		assert('$entityElement instanceof SAML2_XML_md_EntityDescriptor');
 
 		return new SimpleSAML_Metadata_SAMLParser($entityElement, NULL);
 	}
-- 
GitLab