vers. 2.6.0
This commit is contained in:
+17
-57
@@ -7,63 +7,23 @@ $is_ajax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTT
|
||||
|
||||
// Se è una richiesta AJAX, carica solo il contenuto della pagina
|
||||
if ($is_ajax) {
|
||||
switch ($page) {
|
||||
case 'home':
|
||||
include './pages/page/home.php';
|
||||
break;
|
||||
case 'radio':
|
||||
include './pages/page/radio.php';
|
||||
break;
|
||||
case 'tv':
|
||||
include './pages/page/tv.php';
|
||||
break;
|
||||
case 'play':
|
||||
$stationId = (int)$param;
|
||||
$station = getRadioStation($stationId);
|
||||
if ($station !== null) {
|
||||
include './pages/page/player.php';
|
||||
} else {
|
||||
include './pages/page/404.php';
|
||||
}
|
||||
break;
|
||||
case 'playtv':
|
||||
$stationId = (int)$param;
|
||||
$station = getTVStation($stationId);
|
||||
if ($station !== null) {
|
||||
include './pages/page/player_tv.php';
|
||||
} else {
|
||||
include './pages/page/404.php';
|
||||
}
|
||||
break;
|
||||
case 'podcast':
|
||||
include './pages/page/podcast.php';
|
||||
break;
|
||||
case 'page':
|
||||
switch ($param) {
|
||||
case 'about':
|
||||
include './pages/page/about.php';
|
||||
break;
|
||||
case 'contact':
|
||||
include './pages/page/contact.php';
|
||||
break;
|
||||
case 'copyright':
|
||||
include './pages/page/copyright.php';
|
||||
break;
|
||||
case 'termini-condizioni':
|
||||
include './pages/page/terminicondizioni.php';
|
||||
break;
|
||||
case 'policy-privacy':
|
||||
include './pages/page/policyprivacy.php';
|
||||
break;
|
||||
case 'changelog':
|
||||
include './pages/page/changelog.php';
|
||||
break;
|
||||
default:
|
||||
include './pages/page/404.php';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
include './pages/page/404.php';
|
||||
$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
|
||||
}
|
||||
Reference in New Issue
Block a user