mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 10:55:56 +03:00
[GH-ISSUE #1251] Feature request - set $root_path and $root_url from $_SERVER['REQUEST_URI'] #804
Labels
No labels
Feature
Feature
Is It Really an Issue?
Need More Info
Request
Security
bug
duplicate
enhancement
enhancement
help wanted
invalid
pull-request
question
suggestion
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tinyfilemanager#804
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @devnull4242 on GitHub (Nov 15, 2024).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1251
Tiny File Manager is very cool. Thanks.
Unfortunately, in many cases it is necessary to adjust the variables $root_path and $root_url within the code. This is due to the use of subdirectories. Even calling the same file
https://domain.tld/subdomain/tinyfilemanager.phporhttps://subdomain.domain.tld/tinymfilemanager.phpleads to side effects and therefore to security problems under certain circumstances.I would therefore like to suggest automatically extending the values of $root_path and $root_url via
$_SERVER['REQUEST_URI']in such a way that it works for directories and subdirectories as well as for rewrites from e.g.tinyfilemanager.phpto/admin. I think than it works in the most cases without modifications in the code.$base_path is the folder
/pathor/path1/path2... where thephpfilemanager.phpis located. From the point of view of PHP File Manager it is/. If phpfilemanager.php is located in a subdirectory and you want to access directories above it, you would have to set $base_path once manually.$base_path='';You could also dispense with $base_path in the implementation and just use the variable $root_url.