Fix compatibility with latest PHP

This commit is contained in:
2022-01-13 01:31:30 +01:00
parent 28ab33b38f
commit 3b60b1cbed
3 changed files with 78 additions and 76 deletions

View File

@@ -1,3 +1,7 @@
<?php
$lang = $_GET["lang"] ?? "cs";
$page = $_GET["page"] ?? "";
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
@@ -9,33 +13,32 @@
<body><!-- onload="window.print()"-->
<div class="main">
<?php
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$_REQUEST[page]);
if($_REQUEST[page]){
if($_REQUEST[page]=="cestopisy"){
include"./pages/cestopisy/cestopisy.php";
}else if($_REQUEST[page]=="clanky"){
include"./pages/clanky/clanky.php";
}else if($_REQUEST[page]=="akce_ob"){
include"./pages/akce_ob/akce_ob.php";
}else if($_REQUEST[page]=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov.php";
}else if($_REQUEST[page]=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori.php";
}else if($_REQUEST[page]=="zakonceni_2008"){
include"./pages/zakonceni_2008/zakonceni_2008.php";
}elseif(empty($_REQUEST[lang]) AND file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-$_REQUEST[lang].php")){
include"./pages/$escaped_page-$_REQUEST[lang].php";
}else{
include"./pages/404.php";
}}else{
if(empty($_GET["lang"]) OR $_GET["lang"]=="cs"){
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$page);
if($page === ""){
if($lang=="cs"){
include"./pages/cyklogaining.php";
}else{
include"./pages/cyklogaining-en.php";
}
}
}elseif($page=="cestopisy"){
include"./pages/cestopisy/cestopisy.php";
}else if($page=="clanky"){
include"./pages/clanky/clanky.php";
}else if($page=="akce_ob"){
include"./pages/akce_ob/akce_ob.php";
}else if($page=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov.php";
}else if($page=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori.php";
}else if($page=="zakonceni_2008"){
include"./pages/zakonceni_2008/zakonceni_2008.php";
}elseif($lang == "cs" && file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-" . $lang . ".php")){
include"./pages/$escaped_page-" . $lang . ".php";
}else{
include"./pages/404.php";
}
?>
</div>
</body>