Skip to content
Snippets Groups Projects
Commit 17b21b6b authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Patch by Thomas Graff: Handling invalid casing of true and false in authrequest

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1500 44740490-163a-0410-bde0-09ae8108e29a
parent fc53f463
No related branches found
No related tags found
No related merge requests found
...@@ -142,9 +142,9 @@ class SimpleSAML_XML_SAML20_AuthnRequest { ...@@ -142,9 +142,9 @@ class SimpleSAML_XML_SAML20_AuthnRequest {
try{ try{
return $this->isSamlBoolTrue($ispas); return $this->isSamlBoolTrue($ispas);
}catch(Exception $e){ }catch(Exception $e){
// ... I don't understand, default to false // ... I don't understand ...
return FALSE; // return FALSE;
// throw new Exception('Invalid value of IsPassive attribute in SAML2 AuthnRequest.'); throw new Exception('Invalid value of IsPassive attribute in SAML2 AuthnRequest.');
} }
} }
...@@ -171,9 +171,9 @@ class SimpleSAML_XML_SAML20_AuthnRequest { ...@@ -171,9 +171,9 @@ class SimpleSAML_XML_SAML20_AuthnRequest {
try{ try{
return $this->isSamlBoolTrue($fa); return $this->isSamlBoolTrue($fa);
} catch(Exception $e){ } catch(Exception $e){
// ... I don't understand, default to false // ... I don't understand ...
return FALSE; // return FALSE;
// throw new Exception('Invalid value of ForceAuthn attribute in SAML2 AuthnRequest.'); throw new Exception('Invalid value of ForceAuthn attribute in SAML2 AuthnRequest.');
} }
} }
...@@ -308,6 +308,7 @@ class SimpleSAML_XML_SAML20_AuthnRequest { ...@@ -308,6 +308,7 @@ class SimpleSAML_XML_SAML20_AuthnRequest {
* @return bool TRUE or FALSE * @return bool TRUE or FALSE
*/ */
private function isSamlBoolTrue($boolSaml){ private function isSamlBoolTrue($boolSaml){
$boolSaml = strtolower($boolSaml);
if($boolSaml === 'true' || $boolSaml === '1') { if($boolSaml === 'true' || $boolSaml === '1') {
return TRUE; return TRUE;
} elseif($boolSaml === 'false' || $boolSaml === '0') { } elseif($boolSaml === 'false' || $boolSaml === '0') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment