From 50f69065eaaae10de2cb8598515ac44cccee8ae4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 28 Jan 2009 06:49:44 +0000
Subject: [PATCH] bugfixing with saml 2.0 metadata parsing

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1208 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Metadata/SAMLParser.php | 24 ++++++++++++++----------
 modules/cron/www/cron.php              |  2 ++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 216b75784..b8f082c11 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -420,9 +420,14 @@ class SimpleSAML_Metadata_SAMLParser {
 		/*
 		 * Add organizational metadata
 		 */
-		$ret['name'] = $this->organizationDisplayName;
-		$ret['description'] = $this->organizationName;
-		
+		if (!empty($this->organizationName)) {
+			$ret['name'] = $this->organizationName;
+			$ret['description'] = $this->organizationName;
+		}
+		if (!empty($this->organizationDisplayName)) {
+			$ret['name'] = $this->organizationDisplayName;
+		}
+
 		
 		if (!empty($this->tags)) {
 			$ret['tags'] = $this->tags;
@@ -654,8 +659,6 @@ class SimpleSAML_Metadata_SAMLParser {
 
 		$ret = $this->getMetadataCommon();
 
-		$ret['name'] = $this->entityId;
-
 
 		/* Find IdP information which supports the SAML 2.0 protocol. */
 		$idp = $this->getIdPDescriptors(self::$SAML20Protocols);
@@ -692,11 +695,12 @@ class SimpleSAML_Metadata_SAMLParser {
 		$slo = $this->getDefaultEndpoint($idp['singleLogoutServices'], array(self::SAML_20_REDIRECT_BINDING));
 		if($slo !== NULL) {
 			$ret['SingleLogoutService'] = $slo['location'];
-		}
-
-		/* If the response location is set, include it in the returned metadata. */
-		if($slo['responseLocation']) {
-			$ret['SingleLogoutServiceResponse'] = $slo['responseLocation'];
+			
+			/* If the response location is set, include it in the returned metadata. */
+			if(array_key_exists('responseLocation', $slo)) {
+				$ret['SingleLogoutServiceResponse'] = $slo['responseLocation'];
+			}
+			
 		}
 
 
diff --git a/modules/cron/www/cron.php b/modules/cron/www/cron.php
index 6a2190cd8..2f973fbe6 100644
--- a/modules/cron/www/cron.php
+++ b/modules/cron/www/cron.php
@@ -18,6 +18,8 @@ if (!is_null($cronconfig->getValue('allowed_tags'))) {
 	}
 }
 
+
+
 $summary = array(); 
 $croninfo = array(
 	'summary' => &$summary,
-- 
GitLab