Make the old code compatible with modern PHP

This commit is contained in:
2022-01-14 11:52:46 +01:00
parent 87df496efd
commit 0ec0fda566
9 changed files with 283 additions and 242 deletions

View File

@@ -2,7 +2,7 @@
session_start();
$included = true;
$lang = empty($_GET['lang']) ? 'cs' : $_GET['lang'];
$page = htmlspecialchars($_GET['page']);
$page = htmlspecialchars($_GET['page'] ?? 'main');
$url = $_SERVER['REQUEST_URI'];
$root = '/krk/lob2011';
$pretitle = 'LOB 2011';
@@ -16,7 +16,7 @@ $CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS['%pretitle%'] = $pretitle;
$CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string) {
function rplc(string $string): string {
global $CMS;
return str_replace(array_keys($CMS), $CMS, $string);