[BUGFIX] Problem with special character in files and folders 87/17487/2
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 11 Jan 2013 15:23:21 +0000 (16:23 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 12 Jan 2013 15:19:48 +0000 (16:19 +0100)
This patch sanitizes the file name when creating a new file
in the file list.
Folder names already get sanitized.

Change-Id: If97b4a2f41de1334a2b07add6afc1f9d99af3117
Fixes: #42873, #42933
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/17487
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 9fe0d2c..59637fb 100644 (file)
@@ -1064,7 +1064,7 @@ class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver {
                if (!$this->isValidFilename($fileName)) {
                        throw new \TYPO3\CMS\Core\Resource\Exception\InvalidFileNameException('Invalid characters in fileName "' . $fileName . '"', 1320572272);
                }
-               $filePath = $parentFolder->getIdentifier() . ltrim($fileName, '/');
+               $filePath = $parentFolder->getIdentifier() . $this->sanitizeFileName(ltrim($fileName, '/'));
                // TODO set permissions of new file
                $result = touch($this->absoluteBasePath . $filePath);
                clearstatcache();