[GH-ISSUE #1327] Recursively Create Directories Failed or Not Supported #846

Open
opened 2026-03-02 16:01:46 +03:00 by kerem · 1 comment
Owner

Originally created by @marsteel on GitHub (Jun 18, 2025).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1327

To reproduce
Tiny File Manager 2.6

Create New Item
Item Type - Folder
Item Name - /sftpgo/sftpgodata

Folder sftpgosftpgodata is created

Originally created by @marsteel on GitHub (Jun 18, 2025). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/1327 To reproduce [Tiny File Manager 2.6](https://tinyfilemanager.github.io/) Create New Item Item Type - `Folder` Item Name - `/sftpgo/sftpgodata` Folder `sftpgosftpgodata` is created
Author
Owner

@smalos commented on GitHub (Jun 19, 2025):

In the code, there is a cleaning step for the folder name before creation:

$new = str_replace('/', '', fm_clean_path(strip_tags($_POST['newfilename'])));

This line removes all slashes (/) from the folder name. As a result, the input /sftpgo/sftpgodata becomes sftpgosftpgodata.

The question is whether this behavior is intentional for security reasons, or if nested folder creation should be permitted.

<!-- gh-comment-id:2987352198 --> @smalos commented on GitHub (Jun 19, 2025): In the code, there is a cleaning step for the folder name before creation: `$new = str_replace('/', '', fm_clean_path(strip_tags($_POST['newfilename'])));` This line removes all slashes (/) from the folder name. As a result, the input /sftpgo/sftpgodata becomes sftpgosftpgodata. The question is whether this behavior is intentional for security reasons, or if nested folder creation should be permitted.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#846
No description provided.