mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Add array type check on cache returned value
This commit is contained in:
@@ -173,6 +173,9 @@ class phrasea
|
|||||||
if (!self::$_sbas_labels) {
|
if (!self::$_sbas_labels) {
|
||||||
try {
|
try {
|
||||||
self::$_sbas_labels = $app->getApplicationBox()->get_data_from_cache(self::CACHE_SBAS_LABELS);
|
self::$_sbas_labels = $app->getApplicationBox()->get_data_from_cache(self::CACHE_SBAS_LABELS);
|
||||||
|
if (!is_array(self::$_sbas_labels)) {
|
||||||
|
throw new \Exception('Invalid data retrieved from cache');
|
||||||
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
foreach ($app->getDataboxes() as $databox) {
|
foreach ($app->getDataboxes() as $databox) {
|
||||||
self::$_sbas_labels[$databox->get_sbas_id()] = [
|
self::$_sbas_labels[$databox->get_sbas_id()] = [
|
||||||
|
Reference in New Issue
Block a user