[GH-ISSUE #443] Can't Rename Directories when allowed_file_extensions is set #325

Closed
opened 2026-03-02 15:57:50 +03:00 by kerem · 0 comments
Owner

Originally created by @jsn081 on GitHub (Oct 29, 2020).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/443

As of 2.4.5-dev, if I set allowed file extensions in $allowed_file_extensions I am prevented from renaming directories. The rename function is the same for files and directories, and renaming a directory fails the file extensions check. Either directory renaming needs to be handled separately (which is a good idea so I can prevent .hidden directories), or the rename function needs to check if the thing being renamed is a directory, and if it is bypass the extension check.

I was going to slap something together myself, but the fm_rename function doesn't get the path passed to it, so it required more thought and sanity checking than I was willing to trust myself with.

Originally created by @jsn081 on GitHub (Oct 29, 2020). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/443 As of 2.4.5-dev, if I set allowed file extensions in **$allowed_file_extensions** I am prevented from renaming directories. The rename function is the same for files and directories, and renaming a directory fails the file extensions check. Either directory renaming needs to be handled separately (which is a good idea so I can prevent .hidden directories), or the rename function needs to check if the thing being renamed is a directory, and if it is bypass the extension check. I was going to slap something together myself, but the **fm_rename** function doesn't get the path passed to it, so it required more thought and sanity checking than I was willing to trust myself with.
kerem closed this issue 2026-03-02 15:57:50 +03:00
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#325
No description provided.