diff --git a/auth/shibboleth/lib.php b/auth/shibboleth/lib.php index 37f04b9e0f4..62d9bd02c26 100755 --- a/auth/shibboleth/lib.php +++ b/auth/shibboleth/lib.php @@ -1,7 +1,11 @@ $value) { if (!empty($CFG->unicodedb)) { - $result[$key]=$_SERVER[$value]; + $result[$key]= get_first_string($_SERVER[$value]); } else { - $result[$key]=utf8_decode($_SERVER[$value]); + $result[$key]=get_first_string(utf8_decode($_SERVER[$value])); } } @@ -84,4 +88,14 @@ function auth_shib_attributes(){ return $moodleattributes; } + +function get_first_string($string){ +// Cleans and returns first of potential many values (multi-valued attributes) + + $list = split( ';', $string); + $clean_string = rtrim($list[0]); + + return $clean_string; + +} ?>