diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php index 2a9cf416f5..249a1f9838 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php @@ -138,7 +138,7 @@ public function getConfig() return $this->parser->parse($this->loadFile($this->config)); } - if (null !== $this->cache) { + if (null !== $this->cache && is_array($this->cache)) { return $this->cache; } @@ -151,7 +151,13 @@ public function getConfig() )); } - return $this->cache = require $this->compiled; + $this->cache = require $this->compiled; + + if (is_array($this->cache)) { + return $this->cache; + } else { + throw new RuntimeException('Configuration compiled error'); + } } /** diff --git a/lib/Alchemy/Phrasea/Core/Configuration/HostConfiguration.php b/lib/Alchemy/Phrasea/Core/Configuration/HostConfiguration.php index a5badd4a17..9377868c47 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/HostConfiguration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/HostConfiguration.php @@ -151,7 +151,7 @@ public function setDefault($name) */ public function getConfig() { - if (empty($this->cache)) { + if (empty($this->cache) || !is_array($this->cache)) { throw new RuntimeException('Configuration is not set up.'); }