From f1a427a5193b62d1e73bda2eadd8a1e65ad7a3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Fri, 22 Jan 2016 11:39:33 +0100 Subject: [PATCH] Add array type check on cache returned value --- lib/classes/phrasea.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/classes/phrasea.php b/lib/classes/phrasea.php index 16803fe399..211a150e44 100644 --- a/lib/classes/phrasea.php +++ b/lib/classes/phrasea.php @@ -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()] = [