From 6a50d184dec7b85619447b1bdb7425f63de72fcf Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 22 Jul 2010 08:24:42 +0000
Subject: [PATCH] SAML2/Binding: Handle charset parameter in SOAP Content-Type.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2423 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SAML2/Binding.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/SAML2/Binding.php b/lib/SAML2/Binding.php
index b2336ced3..93c15a56f 100644
--- a/lib/SAML2/Binding.php
+++ b/lib/SAML2/Binding.php
@@ -63,12 +63,17 @@ abstract class SAML2_Binding {
 		case 'POST':
 			if (array_key_exists('SAMLRequest', $_REQUEST) || array_key_exists('SAMLResponse', $_REQUEST)) {
 				return new SAML2_HTTPPost();
-			} elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && $_SERVER['CONTENT_TYPE'] === 'text/xml'){
+			} elseif (array_key_exists('CONTENT_TYPE', $_SERVER) && substr($_SERVER['CONTENT_TYPE'], 0, 8) === '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.');
 	}
 
-- 
GitLab