simplesamlphp/saml2

Keep getting notices on setting destination in Message.php ->toUnsignedXML

RNoppy opened this issue · 1 comments

Somehow I keep getting php notices (which bug me) in the toUnsignedXML function of Message.php class when trying to set the destination attribute because the value sometimes isn't a string but an array.
Containing data like:
{
"Location": "https://idp.example.org/SAML2/SSO/Redirect",
"Binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
}

I'm not very familiar with SAML so I don't know why I'm getting an array since the programming obviously expects the value to be a String and I can't find any other known issues about this.
But I think that when contructing the Message class, on line 163-165 there could have been chosen to set the destination differently by using the function setDestination? Like this:

if ($xml->hasAttribute('Destination')) {
$this->setDestination($xml->getAttribute('Destination'));
}

Because this function checks the value on its type.

Furthermore (and now I'm really just guessing), am I correct to asume that in my case the 'location' index of my array should be the rightfull destination value? So maybe the setDestination function should check if it's an array and the 'location' index is set to write that value to destination, else if it's a String to go ahead and set it as the value?

Destination can only be a string.. If it's not, then you're doing something wrong.