[BUGFIX] Catch exception while creating invalid folder 11/44611/2
authorPhilipp Gampe <philipp.gampe@typo3.org>
Sun, 8 Nov 2015 00:09:26 +0000 (01:09 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 9 Nov 2015 20:22:34 +0000 (21:22 +0100)
Creating a folder with in invalid identifier throws an exception.
Catch and handle this exception.

Resolves: #71405
Releases: master
Change-Id: I8e4822d0b3f6ae28cced952af5efcc45d7301317
Reviewed-on: https://review.typo3.org/44611
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php

index 1d346df..8967a32 100644 (file)
@@ -836,6 +836,8 @@ class ExtendedFileUtility extends BasicFileUtility
             $folderName = $cmds['data'];
             $resultObject = $targetFolderObject->createFolder($folderName);
             $this->writelog(6, 0, 1, 'Directory "%s" created in "%s"', array($folderName, $targetFolderObject->getIdentifier() . '/'));
+        } catch (\TYPO3\CMS\Core\Resource\Exception\InvalidFileNameException $e) {
+            $this->writelog(6, 1, 104, 'Invalid folder name "%s"!', [$folderName]);
         } catch (\TYPO3\CMS\Core\Resource\Exception\InsufficientFolderWritePermissionsException $e) {
             $this->writelog(6, 1, 103, 'You are not allowed to create directories!', '');
         } catch (\TYPO3\CMS\Core\Resource\Exception\NotInMountPointException $e) {