Files
rpigroupplay/config/ajaxModule.inc.php
T
2026-07-14 04:33:26 +02:00

29 lines
986 B
PHP

<?php
header('Content-Type: text/html; charset=UTF-8');
// Verifica se è una richiesta AJAX
$is_ajax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
// Se è una richiesta AJAX, carica solo il contenuto della pagina
if ($is_ajax) {
$filePath = getPageFilePath($page, $param);
// Validazione specifica delle stazioni radio e tv per sicurezza
if ($page === 'play' && !empty($param)) {
$stationId = (int)$param;
$station = getRadioStation($stationId);
if ($station === null) {
$filePath = './pages/page/404.php';
}
} elseif ($page === 'playtv' && !empty($param)) {
$stationId = (int)$param;
$station = getTVStation($stationId);
if ($station === null) {
$filePath = './pages/page/404.php';
}
}
include $filePath;
exit; // Termina l'esecuzione per le richieste AJAX
}