Open alienbuild opened 6 years ago
I think, it is expected behaviour, because &
used to split parameters in url.
Php will receive this array
Array (
[a] => system/file/download
[file] => test/Welcome Calls 2nd 3rd
[_4th_April_txt] =>
[wctx] => mgr
[source] => 1
)
The question is - why we can create files with such names in manager?
Urlencode should fix this.
@OptimusCrime Yes.
I`m going to fix it in new media sources for 3.x
Fixed in https://github.com/modxcms/revolution/pull/13811 for MODX 3
Thanks - just to update the problematic character is actually the ',' character, and not the '&' character as I had originally posted.
I believe, it doesn't matter
We're you able to successfully right click and download that file? If the filename contains & it works OK for me and downloads corrextly, but a filename with a comma corrupts the download.
Browser don't like commas in file name on download, so I replace it to _
.
Made few changes, please, try this PR again.
Seems it should e fixed by this one https://github.com/modxcms/revolution/pull/15505 But still valid for 3.x
@alroniks This has been fixed
It does not work for me when I created the file via phpstorm. With commas and &. I will double check on 2.x and 3.x but seems combinations still may break the system.
It also related https://github.com/modxcms/revolution/issues/14060
Summary
File corruption occurs when attempting to downloading a file that contains the comma character.
Step to reproduce
Observed behavior
When downloading the file you get a corrupt file with no extension called 'Welcome Calls 2nd, 3rd_'
Expected behavior
Downloading the file correctly.
Environment
MODX 2.6.1-pl