Skip to content

Commit 7339324

Browse files
MC-42448: [Magento Cloud] Issue with uploading same vimeo video for multiple products.
- Append extension to the filename only when path has an extension.
1 parent 32fda1c commit 7339324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/File/Uploader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,8 @@ public static function getNewFileName($destinationFile)
803803
$fileInfo = pathinfo($destinationFile);
804804
$index = 1;
805805
while ($fileExists($fileInfo['dirname'] . '/' . $fileInfo['basename'])) {
806-
$fileInfo['basename'] = $fileInfo['filename'] . '_' . $index++ . '.' . $fileInfo['extension'];
806+
$fileInfo['basename'] = $fileInfo['filename'] . '_' . ($index++);
807+
$fileInfo['basename'] .= isset($fileInfo['extension']) ? '.' . $fileInfo['extension'] : '';
807808
}
808809

809810
return $fileInfo['basename'];

0 commit comments

Comments
 (0)