diff --git a/src/admin/api.php b/src/admin/api.php index 7d654a18..01cf073f 100644 --- a/src/admin/api.php +++ b/src/admin/api.php @@ -1670,9 +1670,9 @@ if (isset($_SESSION['hash'])) { } $rArray['requests_per_second'] = $rServers[$rServerID]['requests_per_second']; - $rArray['total_streams'] = ($rTotalStreams[$rServerID] ?: 0); - $rArray['total_running_streams'] = ($rOnlineStreams[$rServerID] ?: 0); - $rArray['offline_streams'] = ($rOfflineStreams[$rServerID] ?: 0); + $rArray['total_streams'] = ($rTotalStreams[$rServerID] ?? 0); + $rArray['total_running_streams'] = ($rOnlineStreams[$rServerID] ?? 0); + $rArray['offline_streams'] = ($rOfflineStreams[$rServerID] ?? 0); $rArray['network_guaranteed_speed'] = $rServers[$rServerID]['network_guaranteed_speed']; $rWatchDog = json_decode($rServers[$rServerID]['watchdog_data'], true); @@ -1760,8 +1760,8 @@ if (isset($_SESSION['hash'])) { $rReturn['total_connections'] += $rServers[$rServerID]['connections']; } - $rReturn['total_running_streams'] += ($rOnlineCount[$rServerID] ?: 0); - $rReturn['offline_streams'] += ($rOfflineCount[$rServerID] ?: 0); + $rReturn['total_running_streams'] += ($rOnlineCount[$rServerID] ?? 0); + $rReturn['offline_streams'] += ($rOfflineCount[$rServerID] ?? 0); $rWatchDog = json_decode($rServers[$rServerID]['watchdog_data'], true); if (!is_array($rWatchDog)) { diff --git a/src/admin/server.php b/src/admin/server.php index 446f49a9..78af2a1c 100644 --- a/src/admin/server.php +++ b/src/admin/server.php @@ -23,7 +23,7 @@ $rInterfaces = !empty($rServerArr['interfaces']) ? json_decode($rServerArr['inte $rCertificate = !empty($rServerArr['certbot_ssl']) ? json_decode($rServerArr['certbot_ssl'], true) : []; $rCertValid = false; -if ($rCertificate['expiration']) { +if (isset($rCertificate['expiration'])) { $rHasCert = true; if (time() < $rCertificate['expiration']) { @@ -146,7 +146,7 @@ include 'header.php'; ?>
+ value="">
diff --git a/src/includes/CoreUtilities.php b/src/includes/CoreUtilities.php index efbbdb15..a1ed9fee 100644 --- a/src/includes/CoreUtilities.php +++ b/src/includes/CoreUtilities.php @@ -2632,9 +2632,12 @@ class CoreUtilities { self::$db->query('UPDATE `lines` SET `forced_country` = ? WHERE `id` = ?', $rUserInfo['forced_country'], $rUserInfo['id']); } } + + $allowedIPS = json_decode($rUserInfo['allowed_ips'], true); + $allowedUa = json_decode($rUserInfo['allowed_ua'], true); $rUserInfo['bouquet'] = json_decode($rUserInfo['bouquet'], true); - $rUserInfo['allowed_ips'] = @array_filter(@array_map('trim', @json_decode($rUserInfo['allowed_ips'], true))); - $rUserInfo['allowed_ua'] = @array_filter(@array_map('trim', @json_decode($rUserInfo['allowed_ua'], true))); + $rUserInfo['allowed_ips'] = array_filter(array_map('trim', is_array($allowedIPS) ? $allowedIPS : [])); + $rUserInfo['allowed_ua'] = array_filter(array_map('trim', is_array($allowedUa) ? $allowedUa : [])); $rUserInfo['allowed_outputs'] = array_map('intval', json_decode($rUserInfo['allowed_outputs'], true)); $rUserInfo['output_formats'] = array(); if (self::$rCached) { diff --git a/src/includes/streaming.php b/src/includes/streaming.php index 63df01c2..43283d30 100644 --- a/src/includes/streaming.php +++ b/src/includes/streaming.php @@ -1042,9 +1042,12 @@ class StreamingUtilities { self::$db->query('UPDATE `lines` SET `forced_country` = ? WHERE `id` = ?', $rUserInfo['forced_country'], $rUserInfo['id']); } } + + $allowedIPS = json_decode($rUserInfo['allowed_ips'], true); + $allowedUa = json_decode($rUserInfo['allowed_ua'], true); $rUserInfo['bouquet'] = json_decode($rUserInfo['bouquet'], true); - $rUserInfo['allowed_ips'] = @array_filter(@array_map('trim', @json_decode($rUserInfo['allowed_ips'], true))); - $rUserInfo['allowed_ua'] = @array_filter(@array_map('trim', @json_decode($rUserInfo['allowed_ua'], true))); + $rUserInfo['allowed_ips'] = array_filter(array_map('trim', is_array($allowedIPS) ? $allowedIPS : [])); + $rUserInfo['allowed_ua'] = array_filter(array_map('trim', is_array($allowedUa) ? $allowedUa : [])); $rUserInfo['allowed_outputs'] = array_map('intval', json_decode($rUserInfo['allowed_outputs'], true)); $rUserInfo['output_formats'] = array(); if (self::$rCached) { diff --git a/src/ministra/portal.php b/src/ministra/portal.php index 9481d46b..386b8ce2 100644 --- a/src/ministra/portal.php +++ b/src/ministra/portal.php @@ -172,8 +172,7 @@ if (!StreamingUtilities::$rSettings['disable_ministra']) { } } - if (!($rDevice && $rReqType == 'stb' && $rReqAction == 'get_profile')) { - } else { + if ($rDevice && $rReqType == 'stb' && $rReqAction == 'get_profile') { $rSerialNumber = (!empty(StreamingUtilities::$rRequest['sn']) ? StreamingUtilities::$rRequest['sn'] : null); $rSTBType = (!empty(StreamingUtilities::$rRequest['stb_type']) ? StreamingUtilities::$rRequest['stb_type'] : null); $rVersion = (!empty(StreamingUtilities::$rRequest['ver']) ? StreamingUtilities::$rRequest['ver'] : null); @@ -235,8 +234,7 @@ if (!StreamingUtilities::$rSettings['disable_ministra']) { $rVerified = false; } - if (!$rDebug) { - } else { + if ($rDebug) { $rVerified = true; } diff --git a/src/www/init.php b/src/www/init.php index b86bf0d0..2e017153 100644 --- a/src/www/init.php +++ b/src/www/init.php @@ -26,7 +26,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])) { $rFilename = strtolower(basename(get_included_files()[0], '.php')); if (!in_array($rFilename, array('enigma2', 'epg', 'playlist', 'api', 'xplugin', 'live', 'proxy_api', 'thumb', 'timeshift', 'vod')) || isset($argc)) { - $db = new Database($_INFO['username'], $_INFO['password'], $_INFO['database'], $_INFO['hostname'], $_INFO['port']);; + $db = new Database($_INFO['username'], $_INFO['password'], $_INFO['database'], $_INFO['hostname'], $_INFO['port']); CoreUtilities::$db = &$db; CoreUtilities::init(); } else {