diff --git a/export.php b/export.php index ba79075..dabfc60 100644 --- a/export.php +++ b/export.php @@ -6,6 +6,9 @@ gridtv_require_admin($config, 'Export'); [$locale, $L] = gridtv_load_locale($config); function export_parse_xmltv_programmes(string $xml, string $target_day): array { + if (!class_exists('DOMDocument')) { + return ['channels' => [], 'programmes' => [], 'error' => 'PHP DOM/XML extension is not installed']; + } libxml_use_internal_errors(true); $dom = new DOMDocument(); if (!$dom->loadXML($xml, LIBXML_NOERROR | LIBXML_NOWARNING)) { diff --git a/health.php b/health.php index d5e7434..786790d 100644 --- a/health.php +++ b/health.php @@ -14,6 +14,9 @@ function health_status_label(bool $ok): string { } function health_parse_xmltv(string $xml): array { + if (!class_exists('DOMDocument')) { + return ['ok' => false, 'error' => 'PHP DOM/XML extension is not installed.']; + } if ($xml === '') { return ['ok' => false, 'error' => 'Empty response']; } diff --git a/src/lib/admin.php b/src/lib/admin.php index c7eadda..4c14170 100644 --- a/src/lib/admin.php +++ b/src/lib/admin.php @@ -3,7 +3,9 @@ require_once __DIR__ . '/common.php'; function gridtv_require_admin(array $config, string $page_title = 'Admin'): array { - session_start(); + if (session_status() !== PHP_SESSION_ACTIVE) { + session_start(); + } $admin_key = (string) ($config['admin_key'] ?? ''); $session_key = $_SESSION['gridtv_admin_unlocked'] ?? ''; diff --git a/src/tpl/topbar.php b/src/tpl/topbar.php index 43468b3..99f83b3 100644 --- a/src/tpl/topbar.php +++ b/src/tpl/topbar.php @@ -12,6 +12,7 @@ + PDF 1 || $allow_personal_epg): ?>