From 1f4d1c7b87a60f9437629c5e6aecb724f3766a41 Mon Sep 17 00:00:00 2001
From: Jaime Perez <jaime.perez@uninett.no>
Date: Mon, 10 Nov 2014 12:39:17 +0100
Subject: [PATCH] Avoid the friendly names in attribute definitions to end up
 in the PHP generated metadata, as it creates trouble for the AttributeLimit
 filter and others.

---
 modules/saml/www/sp/metadata.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/saml/www/sp/metadata.php b/modules/saml/www/sp/metadata.php
index f1a7d88a0..becac2d2d 100644
--- a/modules/saml/www/sp/metadata.php
+++ b/modules/saml/www/sp/metadata.php
@@ -207,6 +207,9 @@ unset($metaArray20['UIInfo']);
 unset($metaArray20['metadata-set']);
 unset($metaArray20['entityid']);
 
+// sanitize the attributes array to remove friendly names
+$metaArray20['attributes'] = array_values($metaArray20['attributes']);
+
 /* Sign the metadata if enabled. */
 $xml = SimpleSAML_Metadata_Signer::sign($xml, $spconfig->toArray(), 'SAML 2 SP');
 
-- 
GitLab