diff options
author | Olav Morken <olav.morken@uninett.no> | 2010-07-22 08:48:53 +0000 |
---|---|---|
committer | Olav Morken <olav.morken@uninett.no> | 2010-07-22 08:48:53 +0000 |
commit | ed9eebe95b8a7526a23a69209070bca7dd02d296 (patch) | |
tree | 0fe622a8ecfd9812365121d4c27a217568ea2c3c /lib/SAML2 | |
parent | 7b889244cc4afc6bf7fe1bb87dd49e83adccc33e (diff) | |
download | simplesamlphp-ed9eebe95b8a7526a23a69209070bca7dd02d296.zip simplesamlphp-ed9eebe95b8a7526a23a69209070bca7dd02d296.tar.gz simplesamlphp-ed9eebe95b8a7526a23a69209070bca7dd02d296.tar.bz2 |
SAML2_Binding: Proper check for content type.
In r2423, I committed an incomplete fix. This is the proper fix.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2429 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SAML2')
-rw-r--r-- | lib/SAML2/Binding.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/SAML2/Binding.php b/lib/SAML2/Binding.php index 93c15a5..1e05ee4 100644 --- a/lib/SAML2/Binding.php +++ b/lib/SAML2/Binding.php @@ -61,19 +61,21 @@ abstract class SAML2_Binding { break; case 'POST': + if (isset($_SERVER['CONTENT_TYPE'])) { + $contentType = $_SERVER['CONTENT_TYPE']; + $contentType = explode(';', $contentType); + $contentType = $contentType[0]; /* Remove charset. */ + } else { + $contentType = NULL; + } if (array_key_exists('SAMLRequest', $_REQUEST) || array_key_exists('SAMLResponse', $_REQUEST)) { return new SAML2_HTTPPost(); - } elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && substr($_SERVER['CONTENT_TYPE'], 0, 8) === 'text/xml'){ + } elseif ($contentType === 'text/xml') { return new SAML2_SOAP(); } break; } - $s = var_export($_SERVER, TRUE); - foreach (explode("\n", $s) as $l) { - error_log($l); - } - throw new Exception('Unable to find the current binding.'); } |