Project

General

Profile

Actions

Bug #50538

closed

Allowed Characters for Filenames

Added by Lucas Bremgartner almost 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2013-07-29
Due date:
% Done:

100%

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

Description

If working with Image-Files for Retina-Displays there is the need for filenames with the character @ in it, e.g. image@2x.jpg.

The character @ is prevented by the function cleanFileName in class.t3lib_basicfilefunc.php (respectively BasicFileUtility.php for version >6.0).

But the behavior is inconsistent. If $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'] is set, the character @ is allowed, because \x40 is not excluded by the regex.

Therefor, I suggest to allow the @ character in filenames in non-utf8-filesystems as well.

To achieve this, the line

$cleanFileName = preg_replace('/[^.[:alnum:]_-]/', '_', trim($fileName));

should be changed to

$cleanFileName = preg_replace('/[^.[:alnum:]@_-]/', '_', trim($fileName));

Actions

Also available in: Atom PDF