Fix PHP warnings and change from xhtml to html

This commit is contained in:
2025-09-17 15:29:36 +02:00
parent fc93e5097b
commit 31177bc3fc
3 changed files with 28 additions and 18 deletions

View File

@@ -5,16 +5,18 @@ global $COMBINED_ACCESS;
$info = explode('/', $_SERVER['PATH_INFO']);
$client = null;
foreach ($CLIENT_ACCESS as $name => $data) {
if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) {
$client = $data;
$client['id'] = $name;
if (sizeof($info) > 1) {
foreach ($CLIENT_ACCESS as $name => $data) {
if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) {
$client = $data;
$client['id'] = $name;
}
}
}
foreach ($COMBINED_ACCESS as $name => $data) {
if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) {
$client = $data;
$client['id'] = $name;
foreach ($COMBINED_ACCESS as $name => $data) {
if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) {
$client = $data;
$client['id'] = $name;
}
}
}
if ($client === null) {
@@ -27,7 +29,7 @@ if ($client === null) {
exit();
}
if ($client['api']) {
if (isset($client['api'])) {
$data = "window.ELWIG_API = \"$client[api]\";";
} else {
$data = "window.CLIENTS = {";
@@ -41,18 +43,17 @@ if ($client['api']) {
$data .= "};";
}
header('Content-Type: application/xhtml+xml; charset=UTF-8');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="de">
header('Content-Type: text/html; charset=UTF-8'); ?>
<html lang="de">
<head>
<meta charset="UTF-8"/>
<title><?php echo $client['name']; ?> - Elwig</title>
<link rel="icon" href="/favicon.ico" sizes="16x16 20x20 24x24 30x30 32x32 36x36 40x40 48x48 60x60 64x64 72x72 80x80 96x96 128x128 256x256"/>
<link rel="stylesheet" href="/res/style.css"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<script>window.CLIENT = "<?php echo $info[1]; ?>"; <?php echo $data; ?></script>
<script src="/res/access.js" type="application/javascript"/>
<script src="<?php echo $client['api'] ? "/res/access-single.js" : "/res/access-multiple.js"; ?>" type="application/javascript"/>
<script>window.CLIENT = "<?php echo $info[1] ?? ""; ?>"; <?php echo $data; ?></script>
<script src="/res/access.js" type="application/javascript"></script>
<script src="<?php echo isset($client['api']) ? "/res/access-single.js" : "/res/access-multiple.js"; ?>" type="application/javascript"></script>
</head>
<body class="header-footer">
<header>
@@ -83,7 +84,7 @@ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
</div>
</nav>
</header>
<main id="access"/>
<main id="access"></main>
<footer>
<a href="https://elwig.at/"><img src="/res/elwig.png" alt="Elwig"/></a>
<p>