Closed fritzmg closed 3 years ago
[...] and do not disable Do not check/rename uploaded files [...] uploaded files do not get automatically renamed anymore.
Did I understand you correctly? So you mean Do not check/rename uploaded files
should be checked - like this?
If so renaming seems to work just fine in my local 4.9.21
Did I understand you correctly? So you mean
Do not check/rename uploaded files
should be checked - like this?
No, it should not be checked, i.e. the sanitation should not be disabled. The issue only occurs when sanitation is not disabled.
Ah okay, got it.
Hmm it seems like we'd need to take care of doNotOverwrite
ourself.
Hmm it seems like we'd need to take care of
doNotOverwrite
ourself.
Hm, may be you could also use the loadFormField
hook instead. In there you could check additionally for
if (Input::post('FORM_SUBMIT') !== $formId) {
return $objWidget;
}
And then you would manipulate $_FILES[$objWidget->name]
instead of $_SESSION['FILES'][$objWidget->name]
. Then afterwards FormFileUpload::validate
would work as usual and take care of everything.
Hm, may be you could also use the
loadFormField
hook instead.
Ah, love the "out of the box thinking"! Seems to work even better and saves us so much trouble :) Implemented in 713d3748edf1cc3df20c875073108a05e3a5e2bf
If you enable the options Store uploaded files and Preserve existing files (and do not disable Do not check/rename uploaded files) and then upload a file with illegal characters in its name (which are then sanitised) twice or more, the uploaded files do not get automatically renamed anymore.