modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

File with two dots in name can be uploaded, but not deleted #14320

Open sebastian-marinescu opened 5 years ago

sebastian-marinescu commented 5 years ago

Bug report

Summary

The MODX media-manager allows uploading of files with two dots ("..") in the filename, but deleting it is impossible.

Step to reproduce

Create a txt-file with the name datei-mit_zwei..punkten.txt. Upload it via media-manager. Try to delete it afterwards.

Observed behavior

Trying to delete it throws an error: image (the error says: "Please provide a valid directory")

Expected behavior

It should either not allow uploading such files in the first place, or if it does, make sure it can be deleted.

Environment

MODX 2.7.0-pl

SnowCreative commented 4 years ago

Same story for files uploaded with "?" or "&" in the file name. Isn't there some way we can prevent bad characters from being used in upload file names?

Ruslan-Aleev commented 4 years ago

Possibly related with https://github.com/modxcms/revolution/issues/15271

sebastian-marinescu commented 1 year ago

Just tested it in v2.8.5 and v3.0.2.

It still doesn't work. The original filename is: datei-mit-2..-punkten.txt

In v2.8.5 it doesn't find the file and it looks like it strips both dots .. from the filename. It also looks like MODX thinks it is a directory. image

In v3.0.2 it doesn't find the file and it looks like it strips one dot . from the filename. image

Could be related to https://github.com/modxcms/revolution/issues/16351