From 5eaab871e37bfedc1ad6532829031dcfa93c3d09 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 21 Nov 2018 15:04:51 +0100 Subject: [locationinfo] Fix infinite loop with malformed backend data --- modules-available/locationinfo/inc/infopanel.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules-available/locationinfo') diff --git a/modules-available/locationinfo/inc/infopanel.inc.php b/modules-available/locationinfo/inc/infopanel.inc.php index edeb9ccf..918030f0 100644 --- a/modules-available/locationinfo/inc/infopanel.inc.php +++ b/modules-available/locationinfo/inc/infopanel.inc.php @@ -75,6 +75,8 @@ class InfoPanel } /** + * {"language":"de","mode":1,"vertical":true,"eco":false,"scaledaysauto":true,"daystoshow":7,"rotation":0,"scale":56,"switchtime":10,"calupdate":120,"roomupdate":20, + * "overrides": { "12" : { "mode":4} } * Gets the location info of the given locations. * Append to passed array which is expected to * map location ids to properties of that location. @@ -157,6 +159,8 @@ class InfoPanel // Iterate over the locations we're actually interested in $locations = Location::getLocationsAssoc(); foreach ($idList as $locationId) { + if (empty($locationId)) + continue; // Start checking at actual location... $currentId = $locationId; while ($currentId !== 0) { @@ -175,6 +179,8 @@ class InfoPanel } } // Keep trying with parent + if (!isset($locations[$currentId])) + break; $currentId = $locations[$currentId]['parentlocationid']; } } -- cgit v1.2.3-55-g7522