From f83c2f20f9224ed352ea6c0d0a0157607652a10b Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Mon, 14 Oct 2013 06:55:59 +0000 Subject: [PATCH] AttributeMap: Fix infinite loop when overwriting attributes with AttributeMap. Thanks to Brook Schofield for implementing this fix! git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3278 44740490-163a-0410-bde0-09ae8108e29a --- modules/core/lib/Auth/Process/AttributeMap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/core/lib/Auth/Process/AttributeMap.php b/modules/core/lib/Auth/Process/AttributeMap.php index 8df240c3b..4193f9521 100644 --- a/modules/core/lib/Auth/Process/AttributeMap.php +++ b/modules/core/lib/Auth/Process/AttributeMap.php @@ -82,13 +82,16 @@ class sspmod_core_Auth_Process_AttributeMap extends SimpleSAML_Auth_ProcessingFi foreach($attributes as $name => $values) { if(array_key_exists($name, $this->map)) { - unset($attributes[$name]); if(!is_array($this->map[$name])) { + unset($attributes[$name]); $attributes[$this->map[$name]] = $values; } else { foreach($this->map[$name] as $to_map) { $attributes[$to_map] = $values; } + if (!in_array($name, $this->map[$name])) { + unset($attributes[$name]); + } } } } -- GitLab