[BUGFIX] FAL: Allow filenames like "0" 82/37782/3
authorMalte Muth <muth@fh-konzept.de>
Thu, 12 Mar 2015 06:56:57 +0000 (07:56 +0100)
committerFrans Saris <franssaris@gmail.com>
Fri, 13 Mar 2015 07:19:48 +0000 (08:19 +0100)
When sanitizing file names, the condition is now checks less greedy
and does not reject filenames like "0" anymore.

Change-Id: I8b7aab813390f836a4e4edb418b77a7525d247d0
Releases: master, 6.2
Resolves: #65673
Reviewed-on: http://review.typo3.org/37782
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index b543c22..dbf5789 100644 (file)
@@ -320,9 +320,9 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver {
                }
                // Strip trailing dots and return
                $cleanFileName = rtrim($cleanFileName, '.');
-               if (!$cleanFileName) {
+               if ($cleanFileName === '') {
                        throw new Exception\InvalidFileNameException(
-                               'File name ' . $cleanFileName . ' is invalid.',
+                               'File name ' . $fileName . ' is invalid.',
                                1320288991
                        );
                }