From 5fcfcb7182d590457ffd978d27309f7d9c08cb9f Mon Sep 17 00:00:00 2001 From: Tomita Militaru Date: Thu, 1 Mar 2018 17:46:38 +0200 Subject: [PATCH] [BUGFIX] Fix issue #28 --- Classes/Service/UploadFileService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/Service/UploadFileService.php b/Classes/Service/UploadFileService.php index 5bc4659..3964ece 100644 --- a/Classes/Service/UploadFileService.php +++ b/Classes/Service/UploadFileService.php @@ -93,6 +93,8 @@ protected function sanitizeFileNameAndPath($uploadedFileName) // Also check the path does not contain any back segment like "..". if (count($pathSegments) === 2 && strpos($uploadedFileName, '..') === false) { $sanitizedFileNameAndPath = UploadManager::UPLOAD_FOLDER . $pathSegments[1]; + } elseif (count($pathSegments) === 1 && strpos($uploadedFileName, '..') === false) { + $sanitizedFileNameAndPath = UploadManager::UPLOAD_FOLDER . $pathSegments[0]; } return $sanitizedFileNameAndPath; }