From dd0faa97a3c890e90d9307cde57e797146a97d3c Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 14 Jun 2025 12:29:00 +0400 Subject: upd: use REQUEST_URI for file id fetching --- public/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index 393940d..9e6ccf1 100644 --- a/public/index.php +++ b/public/index.php @@ -16,9 +16,10 @@ if (FILE_CATALOG_RANDOM && isset($_GET['random'])) { $file = null; $file_id = null; +$url = parse_url($_SERVER['REQUEST_URI']); -if (strlen(substr($_SERVER['PHP_SELF'], strlen('/index.php'))) > 0) { - $file_id = basename($_SERVER['PHP_SELF']); +if (strlen($url['path']) > 1) { + $file_id = basename($url['path']); } if (FILE_CATALOG_FANCY_VIEW && $file_id) { -- cgit v1.2.3