Fix security vuln

Special thanks to Mina for finding this
This commit is contained in:
Guangcong Luo 2026-03-16 07:05:10 +00:00
parent 54a573b815
commit 647308216a

View File

@ -749,6 +749,8 @@ if (function_exists('dirindex_intro')) {
$has_sprites = false;
$special_sprites = function_exists('dirindex_sprites');
$view = $_GET['view'] ?? ($special_sprites ? 'sprites' : 'dir');
if (!ctype_alnum($view)) die('Access denied; invalid view');
if ($special_sprites || array_key_exists($rel_dir, $sprites_whitelist)) {
$has_sprites = true;
if ($view === 'sprites') {