[BUGFIX] File-Upload does not sanitize umlauts in filenames 64/17464/3
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 11 Jan 2013 14:46:15 +0000 (15:46 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 12 Jan 2013 15:10:59 +0000 (16:10 +0100)
This patch sanitizes file names for uploaded files, fixing thumbnail
and deletion issues for files with umlauts.

Change-Id: I9c02e357b7b37d1c09656ed14f50a8adb7593d52
Fixes: #42925
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/17464
Reviewed-by: Tilo Baller
Tested-by: Tilo Baller
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 87df267..9fe0d2c 100644 (file)
@@ -573,7 +573,7 @@ class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver {
                        throw new \InvalidArgumentException('Cannot add a file that is already part of this storage.', 1314778269);
                }
                $relativeTargetPath = ltrim($targetFolder->getIdentifier(), '/');
-               $relativeTargetPath .= $fileName ? $fileName : basename($localFilePath);
+               $relativeTargetPath .= $this->sanitizeFileName($fileName ? $fileName : basename($localFilePath));
                $targetPath = $this->absoluteBasePath . $relativeTargetPath;
                if (is_uploaded_file($localFilePath)) {
                        $moveResult = move_uploaded_file($localFilePath, $targetPath);