mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-08 08:52:23 +02:00
Fix PHP 5.X (#494)
Arrays cannot be used in "define" functions with PHP versions lower than 7.X Solution given via my professional account (ArlorNaturalScientific)
This commit is contained in:
parent
442843239c
commit
603f048722
|
@ -369,7 +369,7 @@ defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path);
|
||||||
defined('FM_LANG') || define('FM_LANG', $lang);
|
defined('FM_LANG') || define('FM_LANG', $lang);
|
||||||
defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $allowed_file_extensions);
|
defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $allowed_file_extensions);
|
||||||
defined('FM_UPLOAD_EXTENSION') || define('FM_UPLOAD_EXTENSION', $allowed_upload_extensions);
|
defined('FM_UPLOAD_EXTENSION') || define('FM_UPLOAD_EXTENSION', $allowed_upload_extensions);
|
||||||
defined('FM_EXCLUDE_ITEMS') || define('FM_EXCLUDE_ITEMS', $exclude_items);
|
defined('FM_EXCLUDE_ITEMS') || define('FM_EXCLUDE_ITEMS', (version_compare(PHP_VERSION, '7.0.0', '<') ? serialize($exclude_items) : $exclude_items));
|
||||||
defined('FM_DOC_VIEWER') || define('FM_DOC_VIEWER', $online_viewer);
|
defined('FM_DOC_VIEWER') || define('FM_DOC_VIEWER', $online_viewer);
|
||||||
define('FM_READONLY', $use_auth && !empty($readonly_users) && isset($_SESSION[FM_SESSION_ID]['logged']) && in_array($_SESSION[FM_SESSION_ID]['logged'], $readonly_users));
|
define('FM_READONLY', $use_auth && !empty($readonly_users) && isset($_SESSION[FM_SESSION_ID]['logged']) && in_array($_SESSION[FM_SESSION_ID]['logged'], $readonly_users));
|
||||||
define('FM_IS_WIN', DIRECTORY_SEPARATOR == '\\');
|
define('FM_IS_WIN', DIRECTORY_SEPARATOR == '\\');
|
||||||
|
@ -2401,7 +2401,15 @@ function fm_get_parent_path($path)
|
||||||
*/
|
*/
|
||||||
function fm_is_exclude_items($file) {
|
function fm_is_exclude_items($file) {
|
||||||
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
||||||
if(!in_array($file, FM_EXCLUDE_ITEMS) && !in_array("*.$ext", FM_EXCLUDE_ITEMS)) {
|
if (sizeof($exclude_items)) {
|
||||||
|
unset($exclude_items);
|
||||||
|
}
|
||||||
|
|
||||||
|
$exclude_items = FM_EXCLUDE_ITEMS;
|
||||||
|
if (version_compare(PHP_VERSION, '7.0.0', '<')) {
|
||||||
|
$exclude_items = unserialize($exclude_items);
|
||||||
|
}
|
||||||
|
if (!in_array($file, $exclude_items) && !in_array("*.$ext", $exclude_items)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue