Skip to content
Snippets Groups Projects
Commit 5d1b1421 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Bugfix: if an optional configuration is missing, we shouldn't register it to...

Bugfix: if an optional configuration is missing, we shouldn't register it to reuse it later (i.e. loading a config file as optional first and as mandatory later would make the second call to work -while it shouldn't-, since an empty config was loaded during the first call).
parent 356551ea
No related branches found
No related tags found
No related merge requests found
...@@ -121,8 +121,10 @@ class SimpleSAML_Configuration ...@@ -121,8 +121,10 @@ class SimpleSAML_Configuration
// file does not exist, but is required // file does not exist, but is required
throw new Exception('Missing configuration file: '.$filename); throw new Exception('Missing configuration file: '.$filename);
} else { } else {
// file does not exist, but is optional // file does not exist, but is optional, so return an empty configuration object without saving it
$config = array(); $cfg = new SimpleSAML_Configuration(array(), $filename);
$cfg->filename = $filename;
return $cfg;
} }
$cfg = new SimpleSAML_Configuration($config, $filename); $cfg = new SimpleSAML_Configuration($config, $filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment