diff --git a/admin.php b/admin.php
index f35f865..44b635d 100644
--- a/admin.php
+++ b/admin.php
@@ -1556,7 +1556,7 @@ $runningJobs = active_worker_jobs($config);
-
=h($meta['date'])?>=h($meta['location'])?>
=h((string)$meta['teaser'])?>
=nl2br(h($meta['description']), false)?>
“=h(trim((string)$meta['quote_da'], "\"“”"))?>”
=h(implode(' · ', $detailParts))?>
=page_links('edit',$editPage,$editPages)?>
+=h($meta['date'])?>=h($meta['location'])?>
=h((string)$meta['teaser'])?>
=nl2br(h($meta['description']), false)?>
“=h(trim((string)$meta['quote_da'], "\"“”"))?>”
=h(implode(' · ', $detailParts))?>
=page_links('edit',$editPage,$editPages)?>
Edit input dir
in-dir/=h(basename($editDir))?>
This input directory is =h($editStatus)?>. Editing is disabled until the job completes.
diff --git a/index.php b/index.php
index d518f34..cedb413 100644
--- a/index.php
+++ b/index.php
@@ -4,6 +4,11 @@ $config = require __DIR__ . "/config.php";
foreach (["videos_dir", "thumbs_dir", "uploads_dir"] as $d) if (!is_dir($config[$d])) mkdir($config[$d], 0775, true);
if (!is_dir(__DIR__ . "/cache")) mkdir(__DIR__ . "/cache", 0775, true);
+if (preg_match('~/index\.php(?:\?|$)~', (string)($_SERVER['REQUEST_URI'] ?? '')) && preg_match('/^[0-9]{14}[a-f0-9]{16}$/', (string)($_GET['id'] ?? ''))) {
+ header('Location: /?id=' . rawurlencode((string)$_GET['id']), true, 301);
+ exit;
+}
+
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, "UTF-8"); }
function render_description_html($s){
$html = h($s);
@@ -536,7 +541,7 @@ $siteHeaderTitle = $headerTitles[array_rand($headerTitles)];
$base = pathinfo($name, PATHINFO_FILENAME);
$articleIdForVideo = video_article_id($config, $name);
$permalinkEnabled = $articleIdForVideo !== '' && article_permalink_enabled($config, $articleIdForVideo);
- $permalinkUrl = $permalinkEnabled ? query_url(['id' => $articleIdForVideo]) : '';
+ $permalinkUrl = $permalinkEnabled ? ('/?id=' . rawurlencode($articleIdForVideo)) : '';
$shareUrl = $permalinkEnabled ? ('https://bubulescu.org/?id=' . rawurlencode($articleIdForVideo)) : '';
$url = $config['public_videos'].'/'.rawurlencode($name);
$m = $videoCache[$name]['metadata'] ?? video_metadata($v);