From e4c51ba6adb08c9cb5605be4ca68ff4d34d713d2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Jan 2024 10:57:28 +0100 Subject: [inc/Property] Add type checks now that we use strict_types=1 --- inc/property.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'inc/property.inc.php') diff --git a/inc/property.inc.php b/inc/property.inc.php index 556596f1..aaf03254 100644 --- a/inc/property.inc.php +++ b/inc/property.inc.php @@ -203,9 +203,15 @@ class Property return true; } - public static function getVmStoreConfig() + public static function getVmStoreConfig(): array { - return json_decode(self::get('vmstore-config'), true); + $data = self::get('vmstore-config'); + if (!is_string($data)) + return []; + $data = json_decode($data, true); + if (!is_array($data)) + return []; + return $data; } public static function getVmStoreUrl() -- cgit v1.2.3-55-g7522