Skip to content
Snippets Groups Projects
Unverified Commit 4c5e89d8 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Fix case where attribute-value is not a string

Integers for example are not uncommon..
This closes #1152
parent dcfc4942
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,6 @@ class AttributeNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator ...@@ -54,7 +54,6 @@ class AttributeNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator
*/ */
protected function getValue(array &$state) protected function getValue(array &$state)
{ {
if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) { if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) {
Logger::warning( Logger::warning(
'Missing attribute '.var_export($this->attribute, true). 'Missing attribute '.var_export($this->attribute, true).
...@@ -70,7 +69,7 @@ class AttributeNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator ...@@ -70,7 +69,7 @@ class AttributeNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator
return null; return null;
} }
$value = array_values($state['Attributes'][$this->attribute]); // just in case the first index is no longer 0 $value = array_values($state['Attributes'][$this->attribute]); // just in case the first index is no longer 0
$value = $value[0]; $value = strval($value[0]);
if (empty($value)) { if (empty($value)) {
Logger::warning( Logger::warning(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment