Fix: Error 500 on health.php and export button missing.

This commit is contained in:
Johnnybegood90
2026-03-15 01:50:35 +01:00
parent a81e33ccb8
commit 214a2b9cc5
4 changed files with 10 additions and 1 deletions
+3
View File
@@ -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)) {
+3
View File
@@ -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'];
}
+2
View File
@@ -3,7 +3,9 @@
require_once __DIR__ . '/common.php';
function gridtv_require_admin(array $config, string $page_title = 'Admin'): array {
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$admin_key = (string) ($config['admin_key'] ?? '');
$session_key = $_SESSION['gridtv_admin_unlocked'] ?? '';
+1
View File
@@ -12,6 +12,7 @@
<?php if (!empty($m3u_url)): ?>
<button class="copy-btn" onclick="copyUrl('m3u')" title="<?= htmlspecialchars($L["copy_m3u"]) ?>"><?= htmlspecialchars($L["copy_m3u"]) ?></button>
<?php endif; ?>
<a class="copy-btn" href="/export.php" title="Export 24h">PDF</a>
</div>
<?php if (count($epg_sources) > 1 || $allow_personal_epg): ?>
<div class="source-dropdown" id="sourceDropdown">