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); -
RenderingEditEdit

+
RenderingEditEdit

Edit input dir

in-dir/

This input directory is . Editing is disabled until the job completes.

Edit input dir

in-dir/

Files and captions

No caption for audio files

Add new movie input

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);