Compare commits

...

3 commits

Author SHA1 Message Date
Ijor Tengab 51848bb9cf
Merge 69c681db14 into a1ae0fa729 2024-05-07 21:20:35 +05:30
BANKA2017 a1ae0fa729
fix: #52 Does not respect directory tree while uploading a folder containing sub-folders (#1056) 2024-05-01 10:01:27 +05:30
IjorTengab 69c681db14 Fix #963 2023-02-18 09:14:36 +07:00

View file

@ -608,7 +608,7 @@ if ((isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_
$use_curl = false;
$temp_file = tempnam(sys_get_temp_dir(), "upload-");
$fileinfo = new stdClass();
$fileinfo->name = trim(basename($url), ".\x00..\x20");
$fileinfo->name = trim(urldecode(basename($url)), ".\x00..\x20");
$allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
$ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION));
@ -958,7 +958,7 @@ if (!empty($_FILES) && !FM_READONLY) {
$targetPath = $path . $ds;
if ( is_writable($targetPath) ) {
$fullPath = $path . '/' . basename($fullPathInput);
$fullPath = $path . '/' . $fullPathInput;
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
if (!is_dir($folder)) {