Fixed a SAML metadata parsing bug.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 10 May 2005 20:26:49 +0000 (20:26 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 10 May 2005 20:26:49 +0000 (20:26 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1462 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/metadata/provider/XMLMetadataProvider.java

index d83662b..19c57d8 100644 (file)
@@ -629,10 +629,14 @@ public class XMLMetadataProvider implements Metadata {
                     nameid.add(new XMLEndpoint((Element)nlist.item(i)));
 
                 nlist=e.getElementsByTagNameNS(edu.internet2.middleware.shibboleth.common.XML.SAML2META_NS,"NameIDFormat");
-                for (i=0; i<nlist.getLength(); i++) {
-                    if (nlist.item(i).hasChildNodes())
-                        formats.add(nlist.item(i).getNodeValue());
-                }
+                for (i = 0; i < nlist.getLength(); i++) {
+                                       if (nlist.item(i).hasChildNodes()) {
+                                               Node tnode = nlist.item(i).getFirstChild();
+                                               if (tnode != null && tnode.getNodeType() == Node.TEXT_NODE) {
+                                                       formats.add(tnode.getNodeValue());
+                                               }
+                                       }
+                               }
             }
             else {
                 // For old style, we just do SAML 1.1 compatibility with Shib handles.