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

This commit is contained in:
Michael Aherne
2016-04-04 08:55:39 +01:00
parent 4709d5dfcb
commit b2c13a1120
+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');
}