MDL-53256 cache: Prevent overwriting of cache config with invalid data

This commit is contained in:
Michael Aherne
2016-04-01 08:52:21 +01:00
parent aeccf4bd94
commit f0ed09852e
+5 -1
View File
@@ -330,7 +330,11 @@ class cache_config {
if (!file_exists($cachefile)) {
throw new cache_exception('Default cache config could not be found. It should have already been created by now.');
}
include($cachefile);
if (!include($cachefile)) {
throw new cache_exception('Unable to load the cache configuration file');
}
if (!is_array($configuration)) {
throw new cache_exception('Invalid cache configuration file');
}