Skip to content

Commit

Permalink
Fix deprecation with null value in cache FileStore
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Jan 4, 2024
1 parent 194b7a7 commit 32dd9cd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Illuminate/Cache/FileStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ protected function getPayload($key)
// just return null. Otherwise, we'll get the contents of the file and get
// the expiration UNIX timestamps from the start of the file's contents.
try {
$expire = substr(
$contents = $this->files->get($path, true), 0, 10
);
if (is_null($contents = $this->files->get($path, true))) {
return $this->emptyPayload();
}

$expire = substr($contents, 0, 10);
} catch (Exception) {
return $this->emptyPayload();
}
Expand Down

0 comments on commit 32dd9cd

Please sign in to comment.