Fix cache.php for PHP 8

Automatic conversion of false to array is deprecated
This commit is contained in:
Hani Rouatbi
2022-07-25 17:28:47 +02:00
committed by GitHub
parent 2a0dad70b2
commit 60958455ca

View File

@@ -32,7 +32,7 @@ class cache
{
if (defined('DEV_STAGE'))
{
return false;
return [];
}
$name = preg_replace('![^a-z0-9_]!', '_', $name);
@@ -40,11 +40,11 @@ class cache
if (file_exists(PATH . 'cache/' . $name . '.php'))
{
include PATH . 'cache/' . $name . '.php';
return empty($data) ? false : $data;
return empty($data) ? [] : $data;
}
else
{
return false;
return [];
}
}