From b1672d5da14b40bedb0659798d24d9594156d906 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 8 Feb 2010 09:13:08 +0000
Subject: [PATCH] SAMLBuilder: Add support for attributes.NameFormat.

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

diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php
index dc14e3868..5b3c2bc9f 100644
--- a/lib/SimpleSAML/Metadata/SAMLBuilder.php
+++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php
@@ -360,10 +360,14 @@ class SimpleSAML_Metadata_SAMLBuilder {
 				$attributeconsumer->appendChild($t);
 			}
 
+			$nameFormat = $metadata->getString('attributes.NameFormat', SAML2_Const::NAMEFORMAT_UNSPECIFIED);
 
 			foreach ($attributes as $attribute) {
 				$t = $this->createElement('RequestedAttribute');
 				$t->setAttribute('Name', $attribute);
+				if ($nameFormat !== SAML2_Const::NAMEFORMAT_UNSPECIFIED) {
+					$t->setAttribute('NameFormat', $nameFormat);
+				}
 				$attributeconsumer->appendChild($t);
 			}
 
-- 
GitLab