From e3c27d5d5272a2de459e483b9b6fe84ec6610bd3 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 12 Jul 2010 12:43:59 +0000
Subject: [PATCH] aselect: Fix parsing of multivalued attributes.

Patch by Patrick Honing from issue 322.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2413 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/aselect/lib/Auth/Source/aselect.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/aselect/lib/Auth/Source/aselect.php b/modules/aselect/lib/Auth/Source/aselect.php
index 25caca7cc..2cba46470 100644
--- a/modules/aselect/lib/Auth/Source/aselect.php
+++ b/modules/aselect/lib/Auth/Source/aselect.php
@@ -158,6 +158,9 @@ class sspmod_aselect_Auth_Source_aselect extends SimpleSAML_Auth_Source {
 			foreach (explode('&', $decoded) as $parm) {
 				$tuple = explode('=', $parm);
 				$name = urldecode($tuple[0]);
+				if (preg_match('/\[\]$/',$name)) {
+					$name = substr($name, 0 ,-2);
+				}
 				if (!array_key_exists($name, $attributes)) {
 					$attributes[$name] = array();
 				}
-- 
GitLab