-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renaming folders? #859
Renaming folders? #859
Comments
Pretty sure the problem is that renaming a folder calls the function fm_is_valid_ext which doesn't find the fold name extension as being in the list of allowed extensions (since it's a folder and has no extension), and rejects the rename. I can change my $allowed_file_extensions settings to an empty list and then successfully rename a folder, but if I do that I can also then rename a file to one with an undesirable file extension. So it seems that the renaming of a folder needs to be identified and handled differently than the renaming of a file. Anyone have suggestions / a fix for this? Thanks! |
I sure thought this would work to exclude the renaming of folders from the check on allowed extensions for filenames, but sadly it does not.
|
Solve folder rename when file extension restriction is enabled. Fixes prasathmani#859
Solve folder rename when file extension restriction is enabled. Fixes prasathmani#859
Cool! Thanks. Is there any chance you'd be able to pass on the specific changes that were required? I've made a number of minor revisions on this end that I don't want to lose in any "merge", so if the changes for this fix were minimal it might make me most comfortable to just implement those manually into my file. Thanks again. |
Just have a look in the commit. But here it is anyway:
|
Ah yes, of course. Sorry about that! And thanks again. Very appreciative of the fix. |
If you close an issue before the pull request is merged into the master branch, the pull request is canceled. |
Oh man. My bad. So sorry about that. Clearly I'm not familiar enough with the workings of Github. Reopening, and again, thank you. |
This issue is addressed in the new release. |
Thanks |
Discussed in #858
Originally posted by redherring917b September 20, 2022
Hi there.
I find myself unable to rename an existing folder. I had a similar issue with renaming files, until I realized that I had to add to my allowed list of $allowed_file_extensions in the config.php file that I'm using. But allowing extensions wouldn't apply to folders, obviously. Any thoughts on how to successfully rename a folder?
EDITED: To perhaps be clearer, when attempting to rename a folder I'm just getting the "Error while renaming from [oldname] to [newname]" message, so it would seem to be failing on this condition in tinyfilemanager.php:
if (fm_rename($path . '/' . $old, $path . '/' . $new)) {
I've output both the old and new paths and they are identical save for the changed folder name.
Thanks!
The text was updated successfully, but these errors were encountered: