Bug #14859 » 1280_v2.diff
t3lib/class.t3lib_basicfilefunc.php (working copy) | ||
---|---|---|
* @return string Output string with any characters not matching [.a-zA-Z0-9_-] is substituted by '_'
|
||
*/
|
||
function cleanFileName($fileName,$charset='') {
|
||
// remove trailing dots
|
||
$fileName = preg_replace('/\.*$/','',$fileName);
|
||
|
||
// handle UTF-8 characters
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] == 'utf-8' && $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
|
||
// allow ".", "-", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave)
|
||
... | ... | |
$fileName = $this->csConvObj->specCharsToASCII($charset,$fileName);
|
||
}
|
||
$fileName = preg_replace('/[^.[:alnum:]_-]/','_',trim($fileName));
|
||
return preg_replace('/\.*$/','',$fileName);
|
||
return preg_replace('/[^.[:alnum:]_-]/','_',trim($fileName));
|
||
}
|
||
/**
|
- « Previous
- 1
- 2
- Next »