Fix sitemap

Most importantly, make it work globally.
This commit is contained in:
2022-01-14 05:22:46 +01:00
parent 51c20d672e
commit 4af70fef6d
11 changed files with 33 additions and 193 deletions

View File

@@ -1,9 +1,9 @@
<?php
if ($included !== true) {
header('HTTP/1.0 403 Forbidden');
header('Location: /en/error/403');
exit;
function isHttps(): bool {
// https://www.designcise.com/web/tutorial/how-to-check-for-https-request-in-php
$isHttps = $_SERVER['HTTPS'] ?? $_SERVER['REQUEST_SCHEME'] ?? $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? null;
return $isHttps && (strcasecmp('on', $isHttps) === 0 || strcasecmp('https', $isHttps) === 0);
}
function readPage(string $page): bool {