fix: harden null/missing-key access across stream + provider paths

Fixes warnings/exceptions from production panel logs (v2.3.9), mostly
unguarded access to keys of external provider payloads and to files that
can vanish under races:

- ProvidersCronJob: suppress file_get_contents noise on unreachable
  providers (readURL), and normalise each stream row with defaults
  (`+= [...]`) so missing stream_id/category_id/name/stream_icon/
  epg_channel_id/container_extension no longer warn; skip rows with no
  stream_id. Guard category_id/category_name in the category feeds.
- StreamRedirector: guard the cached stream_ file read (missing cache
  file no longer warns or produces a half-built $rStream), and default
  info.direct_source/direct_proxy.
- stream/probe.php: guard $rChannelInfo (redirectStream may return false)
  and the decoded stream_info before reading codecs/container/bitrate.
- admin/live.php: @filesize on a segment .ts that may be rotated away
  mid-read.
- PlayerApiController: default parse_url()['path'/'host'] and
  $_SERVER['HTTP_USER_AGENT'].
- UserRepository::applyIspInfo: initialise isp_asn default so it is never
  read undefined when the GeoIP lookup returns no ISP.
- admin/providers.php: default max_connections/active_connections for
  providers whose last fetch failed.
This commit is contained in:
Divarion_D
2026-08-16 00:14:42 +03:00
parent 2cd079704f
commit 80c54a0940
7 changed files with 25 additions and 16 deletions
+1
View File
@@ -239,6 +239,7 @@ class UserRepository {
*/
private static function applyIspInfo(array $rUserInfo, $rSettings, $rCached, $rIP, $db): array {
$rUserInfo['con_isp_name'] = null;
$rUserInfo['isp_asn'] = null;
$rUserInfo['isp_violate'] = 0;
$rUserInfo['isp_is_server'] = 0;