diff --git a/index.php b/index.php index 779ee3f..fa11dd1 100644 --- a/index.php +++ b/index.php @@ -132,6 +132,7 @@ function render_blank_page(){ +
@@ -257,7 +258,9 @@ $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)) { render_404_page(); } -render_blank_page(); +if ($articleId === '') { + render_blank_page(); +} if ($articleId !== '') { $videos = array_values(array_filter($videos, function($v) use ($articleId, $config) { @@ -333,15 +336,19 @@ $baseParams = ($rawKeyword !== '') ? ['q' => $rawKeyword] : []; $defaultOgImageUrl = 'https://bubulescu.org/assets/img/bubulescuorg.jpg'; $ogImageUrl = $defaultOgImageUrl; $ogImageAlt = 'MVLog: journal of an unreliable narrator.'; +$pageTitle = 'MVLog'; if ($articleId !== '') { $customOg = article_og_image_url($articleId); if ($customOg !== '') { $ogImageUrl = $customOg; - if (!empty($slice)) { - $firstVideo = basename((string)$slice[0]); - $firstMeta = $videoCache[$firstVideo]['metadata'] ?? video_metadata($slice[0]); - $firstTitle = trim((string)($firstMeta['title'] ?? '')); - if ($firstTitle !== '') $ogImageAlt = 'MVLog: ' . $firstTitle; + } + if (!empty($slice)) { + $firstVideo = basename((string)$slice[0]); + $firstMeta = $videoCache[$firstVideo]['metadata'] ?? video_metadata($slice[0]); + $firstTitle = trim((string)($firstMeta['title'] ?? '')); + if ($firstTitle !== '') { + $ogImageAlt = 'MVLog: ' . $firstTitle; + $pageTitle = 'MVLog: ' . $firstTitle; } } } @@ -354,7 +361,7 @@ $brandUrl = '?id=' . rawurlencode($articleId); -