Merge branch 'MDL-74438-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE

This commit is contained in:
Andrew Nicols
2022-04-08 11:04:02 +08:00
+1 -1
View File
@@ -466,7 +466,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
*/
protected function prep_data_after_read($data) {
$result = @unserialize($data);
if ($result === false) {
if ($result === false && $data != serialize(false)) {
throw new coding_exception('Failed to unserialise data from file. Either failed to read, or failed to write.');
}
return $result;