Skip to content

Commit b5a3b4a

Browse files
authored
Merge pull request #930 from Wunderbyte-GmbH/MOODLE_500_STABLE
Fix #928: User profile fields are not correctly created in response xml
2 parents 3d7e959 + dc885d1 commit b5a3b4a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

idp/sso.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@
8989
// Construct attributes in XML.
9090
$attributexml = '';
9191
foreach ((array)$attributes as $name => $value) {
92-
$attributexml .= '<saml:Attribute Name="' . $name .
93-
'" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">' .
94-
'<saml:AttributeValue>' . htmlspecialchars($value) . '</saml:AttributeValue>' .
95-
'</saml:Attribute>' . "\n";
92+
if (is_string($value)) {
93+
$attributexml .= '<saml:Attribute Name="' . $name .
94+
'" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">' .
95+
'<saml:AttributeValue>' . htmlspecialchars($value) . '</saml:AttributeValue>' .
96+
'</saml:Attribute>' . "\n";
97+
}
9698
}
9799
$email = htmlspecialchars($USER->email);
98100
// Construct XML without signature.

0 commit comments

Comments
 (0)