From 8937de6f4029e6353d236bb9a3eefe44ce8195d5 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Wed, 6 Apr 2022 14:42:10 +0800 Subject: [PATCH] MDL-74438 cache: Check if cached value is boolean false --- cache/stores/file/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 514dc9d7b1551..070ab04421ee3 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -518,7 +518,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;