mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 10:55:56 +03:00
[GH-ISSUE #478] Global variables are null / Config file not readable #353
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#353
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 @sharif-elshobkshy on GitHub (Dec 30, 2020).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/478
Thanks for the web file manager.
We detected several issues.
1) Global variables/scope.
Global variables that are not defined using the "define" function are not available (NULL) in any class or functions. Using global just returns NULL variables.
Function example:
2) Config file.
a) The config file not readable. The following condition returns FALSE.
b) Installing/Downloading this library with composer.
The config file should allow a custom directory (IMHO) so that we can have an external config file outside of the repo.
Changing the config file in this repo can cause issues when updating to a new tinyFileManager version (changes in the config file would be lost).
3) Base path for Tiny File Manager cannot be set.
This causes PHP_SELF to return index.php. This basepath is incorrect when rendering the web file manager is a different URL.
In our case, we were using /browse-files but
$_SERVER['PHP_SELF']still returned index.phpAdded a new config variable
$fm_base_pathto allow user to set a custom FM base path. By default$fm_base_pathvariable is empty.$_SERVER['PHP_SELF'](existing approach) will be used unless value is set to$fm_base_path. This way we don't change current behavior (unless desired).Thanks in advance.
@sharif-elshobkshy commented on GitHub (Jan 5, 2021):
Changes addressed in the following PR.
Refactor tinyFileManager - Global Variables - Config File
Thanks.