[BUGFIX] Use file name to check extension validity 97/28597/3
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 21 Mar 2014 10:37:21 +0000 (11:37 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Mon, 24 Mar 2014 11:02:11 +0000 (12:02 +0100)
Instead of using a file's identifier, the file's name is used
to check if it has a valid file extension.

This allows FAL drivers to use non-file name related identifiers.

Change-Id: I5b870e06f60c9259951a5f20fd69660ab19c49c2
Resolves: #57141
Releases: 6.2
Reviewed-on: https://review.typo3.org/28597
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/Resource/Filter/FileExtensionFilter.php

index 15bd0d6..936c285 100644 (file)
@@ -72,7 +72,7 @@ class FileExtensionFilter {
                                $fileReferenceUid = $parts[count($parts) - 1];
                                $fileReference = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileReferenceObject($fileReferenceUid);
                                $file = $fileReference->getOriginalFile();
-                               if ($this->isAllowed($file->getIdentifier())) {
+                               if ($this->isAllowed($file->getName())) {
                                        $cleanValues[] = $value;
                                } else {
                                        // Remove the erroneously created reference record again