From 807923563d78422f88f9a7705105cd203bc0444e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 4 Dec 2018 12:26:35 +0100 Subject: [locationinfo] Prevent undefined index access --- modules-available/locationinfo/inc/locationinfo.inc.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php index 88f96d29..b996601a 100644 --- a/modules-available/locationinfo/inc/locationinfo.inc.php +++ b/modules-available/locationinfo/inc/locationinfo.inc.php @@ -128,11 +128,13 @@ class LocationInfo } elseif ($row['paneltype'] === 'URL') { // Check if we should set the insecure SSL mode (accept invalid/self signed certs etc.) $data = json_decode($row['panelconfig'], true); - if ($data && $data['insecure-ssl']) { - ConfigHolder::add('SLX_BROWSER_INSECURE', '1'); - } - if ($data && $data['reload-minutes']) { - ConfigHolder::add('SLX_BROWSER_RELOAD_SECS', $data['reload-minutes'] * 60); + if (is_array($data)) { + if (isset($data['insecure-ssl']) && $data['insecure-ssl']) { + ConfigHolder::add('SLX_BROWSER_INSECURE', '1'); + } + if (isset($data['reload-minutes']) && $data['reload-minutes']) { + ConfigHolder::add('SLX_BROWSER_RELOAD_SECS', $data['reload-minutes'] * 60); + } } } ConfigHolder::add('SLX_BROWSER_URL', 'http://' . $_SERVER['SERVER_ADDR'] . '/panel/' . $panelUuid); -- cgit v1.2.3-55-g7522