From 259c08ad0d2172c0b5183b812ec0419076981ec7 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Wed, 8 Jul 2009 10:32:31 +0000 Subject: [PATCH] Bindings_SAML20_HTTPPost: Handle $relayState === NULL. Fix a warning from the post template caused by attempting to include a RelayState parameter with the value NULL. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1553 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Bindings/SAML20/HTTPPost.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php b/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php index 4c934ae2f..b0a840aaa 100644 --- a/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php +++ b/lib/SimpleSAML/Bindings/SAML20/HTTPPost.php @@ -192,10 +192,12 @@ class SimpleSAML_Bindings_SAML20_HTTPPost { } else { - SimpleSAML_Utilities::postRedirect($destination, array( - 'RelayState' => $relayState, - 'SAMLResponse' => base64_encode($response), - )); + $data = array('SAMLResponse' => base64_encode($response)); + if ($relayState !== NULL) { + $data['RelayState'] = $relayState; + } + + SimpleSAML_Utilities::postRedirect($destination, $data); } -- GitLab