Fixed empty landing page

This commit is contained in:
hbrain 2026-06-04 15:11:30 +02:00
parent ab07d7ab35
commit 469243897b

View file

@ -118,6 +118,31 @@ function render_404_page(){
exit; exit;
} }
function render_blank_page(){
$headerTitles = require __DIR__ . '/header_titles.php';
$siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
$brandUrl = '/';
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>MVLog</title>
<link rel="icon" type="image/png" href="assets/img/moto_travel.png">
<link rel="stylesheet" href="style.css?v=20260531u">
<style>html,body{height:100%;overflow:hidden}body{height:100dvh}main{flex:1;min-height:0}</style>
</head>
<body>
<?php include __DIR__ . '/_header.php'; ?>
<main></main>
<?php include __DIR__ . '/_footer.php'; ?>
</body>
</html>
<?php
exit;
}
function video_metadata($path){ function video_metadata($path){
$base = pathinfo($path, PATHINFO_FILENAME); $base = pathinfo($path, PATHINFO_FILENAME);
$meta = [ $meta = [
@ -229,9 +254,10 @@ usort($videos, function($a, $b) use ($videoCache) {
}); });
$articleId = trim((string)($_GET['id'] ?? '')); $articleId = trim((string)($_GET['id'] ?? ''));
if ($articleId === '' || !preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0) { if ($articleId !== '' && (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $articleId) || count(array_diff_key($_GET, ['id' => true])) > 0)) {
render_404_page(); render_404_page();
} }
render_blank_page();
if ($articleId !== '') { if ($articleId !== '') {
$videos = array_values(array_filter($videos, function($v) use ($articleId, $config) { $videos = array_values(array_filter($videos, function($v) use ($articleId, $config) {