summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-14 12:29:00 +0400
committerilotterytea <iltsu@alright.party>2025-06-14 12:29:00 +0400
commitdd0faa97a3c890e90d9307cde57e797146a97d3c (patch)
treebe408eb83fbc33ad9e15adb886c902d5ca722b1f
parentf5e8ace1dd7694cb6f426dc1b3666c11f4e71e78 (diff)
upd: use REQUEST_URI for file id fetching
-rw-r--r--public/index.php5
1 files 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) {