From d2024844034b014342eb0f0092fff39d1fa6fb11 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Fri, 5 Jan 2018 00:40:19 +0100
Subject: [PATCH] Update SAMLParser.php

---
 lib/SimpleSAML/Metadata/SAMLParser.php | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 605145963..8b6f33fe7 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -1,6 +1,5 @@
 <?php
 
-
 /**
  * This is class for parsing of SAML 1.x and SAML 2.0 metadata.
  *
@@ -12,9 +11,9 @@
  * parseDescriptorsFile, parseDescriptorsString or parseDescriptorsElement methods. These functions will return
  * an array of SAMLParser elements where each element represents an EntityDescriptor-element.
  */
+
 class SimpleSAML_Metadata_SAMLParser
 {
-
     /**
      * This is the list of SAML 1.x protocols.
      *
@@ -25,7 +24,6 @@ class SimpleSAML_Metadata_SAMLParser
         'urn:oasis:names:tc:SAML:1.1:protocol',
     );
 
-
     /**
      * This is the list with the SAML 2.0 protocol.
      *
@@ -35,7 +33,6 @@ class SimpleSAML_Metadata_SAMLParser
         'urn:oasis:names:tc:SAML:2.0:protocol',
     );
 
-
     /**
      * This is the entity id we find in the metadata.
      *
@@ -43,7 +40,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $entityId;
 
-
     /**
      * This is an array with the processed SPSSODescriptor elements we have found in this
      * metadata file.
@@ -56,7 +52,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $spDescriptors;
 
-
     /**
      * This is an array with the processed IDPSSODescriptor elements we have found.
      * Each element in the array is an associative array with the elements from parseSSODescriptor and:
@@ -67,7 +62,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $idpDescriptors;
 
-
     /**
      * List of attribute authorities we have found.
      *
@@ -75,7 +69,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $attributeAuthorityDescriptors = array();
 
-
     /**
      * This is an associative array with the organization name for this entity. The key of
      * the associative array is the language code, while the value is a string with the
@@ -85,7 +78,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $organizationName = array();
 
-
     /**
      * This is an associative array with the organization display name for this entity. The key of
      * the associative array is the language code, while the value is a string with the
@@ -95,7 +87,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $organizationDisplayName = array();
 
-
     /**
      * This is an associative array with the organization URI for this entity. The key of
      * the associative array is the language code, while the value is the URI.
@@ -104,7 +95,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $organizationURL = array();
 
-
     /**
      * This is an array of the Contact Persons of this entity.
      *
@@ -112,13 +102,11 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $contacts = array();
 
-
     /**
      * @var array
      */
     private $scopes;
 
-
     /**
      * @var array
      */
@@ -135,7 +123,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $tags;
 
-
     /**
      * This is an array of elements that may be used to validate this element.
      *
@@ -143,7 +130,6 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $validators = array();
 
-
     /**
      * The original EntityDescriptor element for this entity, as a base64 encoded string.
      *
@@ -151,12 +137,11 @@ class SimpleSAML_Metadata_SAMLParser
      */
     private $entityDescriptor;
 
-
     /**
      * This is the constructor for the SAMLParser class.
      *
      * @param \SAML2\XML\md\EntityDescriptor $entityElement The EntityDescriptor.
-     * @param int|NULL                      $maxExpireTime The unix timestamp for when this entity should expire, or
+     * @param int|null                      $maxExpireTime The unix timestamp for when this entity should expire, or
      *     NULL if unknown.
      * @param array                         $validators An array of parent elements that may validate this element.
      * @param array                         $parentExtensions An optional array of extensions from the parent element.
@@ -165,7 +150,7 @@ class SimpleSAML_Metadata_SAMLParser
         \SAML2\XML\md\EntityDescriptor $entityElement,
         $maxExpireTime,
         array $validators = array(),
-        array $parentExtensions = null
+        array $parentExtensions
     ) {
         assert($maxExpireTime === null || is_int($maxExpireTime));
 
@@ -191,7 +176,6 @@ class SimpleSAML_Metadata_SAMLParser
 
         // look over the RoleDescriptors
         foreach ($entityElement->RoleDescriptor as $child) {
-
             if ($child instanceof \SAML2\XML\md\SPSSODescriptor) {
                 $this->processSPSSODescriptor($child, $expireTime);
             } elseif ($child instanceof \SAML2\XML\md\IDPSSODescriptor) {
@@ -1128,7 +1112,7 @@ class SimpleSAML_Metadata_SAMLParser
             }
 
             if ($e->localName === 'Attribute' && $e->namespaceURI === \SAML2\Constants::NS_SAML) {
-                $attribute = $e->getXML();
+                $attribute = $e->xml;
 
                 $name = $attribute->getAttribute('Name');
                 $values = array_map(
-- 
GitLab