From 81dcdcf2097054904f732d25cc3f94533c3b6000 Mon Sep 17 00:00:00 2001 From: Loveangel1337 Date: Sun, 29 Jun 2025 03:48:04 +0100 Subject: [PATCH] Add exit condition is the hashcacheFile fails to create to avoid a redirection loop --- app.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.php b/app.php index 9cdd14e5..0cea23ce 100644 --- a/app.php +++ b/app.php @@ -66,7 +66,11 @@ $hashCacheFile = $viewcachePath . "/$hash.txt"; if (!file_exists($hashCacheFile)) { EmptyFolder($viewcachePath); - touch($hashCacheFile); + if!(touch($hashCacheFile)) + { + // We failed to create the cache file, probably because of a missing write permission, bail! + exit('Unable to write to the viewcache directory.'); + } if (function_exists('opcache_reset')) {