Skip to content

Commit 279404f

Browse files
committed
Add error message for bad OneLogin_Saml2_Settings argument
1 parent f9543a0 commit 279404f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Saml2/Settings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class OneLogin_Saml2_Settings
100100
* @param array|object|null $settings SAML Toolkit Settings
101101
*
102102
* @throws OneLogin_Saml2_Error If any settings parameter is invalid
103+
* @throws Exception If OneLogin_Saml2_Settings is incorrectly supplied
103104
*/
104105
public function __construct($settings = null, $spValidationOnly = false)
105106
{
@@ -123,6 +124,8 @@ public function __construct($settings = null, $spValidationOnly = false)
123124
array(implode(', ', $this->_errors))
124125
);
125126
}
127+
} else if ($settings instanceof OneLogin_Saml2_Settings) {
128+
throw new Exception('Only instances of OneLogin_Saml_Settings are supported.');
126129
} else {
127130
if (!$this->_loadSettingsFromArray($settings->getValues())) {
128131
throw new OneLogin_Saml2_Error(

0 commit comments

Comments
 (0)