From a08b427ee4bfa8b46169c1e7c1e48d4a9abd037f Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Thu, 13 Dec 2007 09:57:01 +0000 Subject: [PATCH] Configuration.php: Avoid notice in error logs if an configuration option isn't set in config.php. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@97 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Configuration.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 7f0c3c198..1f979e491 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -45,6 +45,14 @@ class SimpleSAML_Configuration { if (!isset($this->configuration)) { $this->loadConfig(); } + + /* Avoid notice about non-existant member of array + * if an option isn't set. + */ + if (!array_key_exists($name, $this->configuration)) { + return NULL; + } + return $this->configuration[$name]; } -- GitLab