Skip to content

Commit

Permalink
MDL-74438 cache: Check if cached value is boolean false
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron1729 committed Apr 6, 2022
1 parent b5f5188 commit 8937de6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache/stores/file/lib.php
Expand Up @@ -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;
Expand Down

0 comments on commit 8937de6

Please sign in to comment.