diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 0c08710d55132..5f3920d12cc6a 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -466,7 +466,7 @@ protected function prep_data_before_save($data) { */ 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;