Add array type check on cache returned value

This commit is contained in:
Benoît Burnichon
2016-01-22 11:39:33 +01:00
parent 07a89c26de
commit f1a427a519

View File

@@ -173,6 +173,9 @@ class phrasea
if (!self::$_sbas_labels) {
try {
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) {
foreach ($app->getDataboxes() as $databox) {
self::$_sbas_labels[$databox->get_sbas_id()] = [