From 3e5215b632ed1970918fa992bfb7b344d59e059a Mon Sep 17 00:00:00 2001 From: Marcus Date: Sat, 26 Oct 2024 11:37:31 +0200 Subject: [PATCH] validate empty cache file by filesize --- src/Sushi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sushi.php b/src/Sushi.php index c84ad50..45315e6 100644 --- a/src/Sushi.php +++ b/src/Sushi.php @@ -81,7 +81,7 @@ public static function bootSushi() $states['no-caching-capabilities'](); break; - case file_exists($cachePath) && filemtime($dataPath) <= filemtime($cachePath): + case file_exists($cachePath) && filesize($cachePath) > 0 && filemtime($dataPath) <= filemtime($cachePath): $states['cache-file-found-and-up-to-date'](); break;