Project

General

Profile

Actions

Bug #23847

closed

impossible to effectively set filetype limitations for filelist module

Added by Andreas Kießling about 14 years ago. Updated about 13 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-10-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

16136_v1.patch (5.75 KB) 16136_v1.patch Administrator Admin, 2010-10-26 16:30
16136_v2.patch (5.78 KB) 16136_v2.patch Administrator Admin, 2010-10-26 17:03
Actions #1

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.

Actions #2

Updated by Steffen Gebert about 14 years ago

Committed to trunk rev. 9288

Thanks for your contribution, Andreas!

Actions #3

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".

Actions #4

Updated by Steffen Gebert about 13 years ago

  • Status changed from New to Rejected
  • Target version deleted (0)
Actions

Also available in: Atom PDF