Bug #23847
closedimpossible to effectively set filetype limitations for filelist module
0%
Description
With the settings $TYPO3_CONF_VARS['BE']['fileExtensions']['webspace'] and …['ftpspace'] you ought to be able to restrict what kind of filetypes can be used in the filelist module. But after checking the function "is_allowed" in the class t3lib_basicFileFunctions and the core api documentation at around page 47, you will quickly realize, that the allow setting is pretty useless, because the function interprets "allow" only as a kind of override to "deny". So though you set it to 'pdf,png,gif', you can still upload everything, that is not caught by deny and the additionally checked fileDenyPattern.
Quoting from the core api doc:
The control is done like this: if an extension matches 'allow' then the check returns true. If not and an extension matches 'deny' then the check return false. If no match at all, returns true.
This behaviour should be changed, so that if there is a specific setting for allowed filetypes, you can only use those in your web/ftpspace. The flash uploader already does it that way and let's you only select allowed filetypes, but if you turn it off or don't have a flash plugin, the default check is active.
Solution: clean up the is_allowed function and make it more strict
I also created a testcase for the behaviour of the is_allowed function. This is my first unit test, so any notes on that are welcome.
(issue imported from #M16136)
Files
Updated by Andreas Kießling about 14 years ago
v2: if no config for web/ftpspace is set, the function should return FALSE.
Since the default config from t3lib/config_default.php has a preset, this should be safe to set.
Updated by Steffen Gebert about 14 years ago
Committed to trunk rev. 9288
Thanks for your contribution, Andreas!
Updated by Steffen Gebert about 14 years ago
This change has been reverted in rev. 9324
It is no longer possible to upload files directly e.g. in content element "Image".
Updated by Steffen Gebert about 13 years ago
- Status changed from New to Rejected
- Target version deleted (
0)