Skip to content

Commit 9109198

Browse files
authored
Fix deprecation with null value in cache FileStore (#49578)
1 parent 194b7a7 commit 9109198

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Illuminate/Cache/FileStore.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ protected function getPayload($key)
290290
// just return null. Otherwise, we'll get the contents of the file and get
291291
// the expiration UNIX timestamps from the start of the file's contents.
292292
try {
293-
$expire = substr(
294-
$contents = $this->files->get($path, true), 0, 10
295-
);
293+
if (is_null($contents = $this->files->get($path, true))) {
294+
return $this->emptyPayload();
295+
}
296+
297+
$expire = substr($contents, 0, 10);
296298
} catch (Exception) {
297299
return $this->emptyPayload();
298300
}

0 commit comments

Comments
 (0)