Add exit condition is the hashcacheFile fails to create to avoid a redirection loop

This commit is contained in:
Loveangel1337 2025-06-29 03:48:04 +01:00
parent 6b18b0a7be
commit 81dcdcf209

View File

@ -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'))
{