Skip to content

Commit f086789

Browse files
committed
B2B-2058: ImageUploader uses Name class which works only with local FS
1 parent 2f9e652 commit f086789

File tree

1 file changed

+3
-2
lines changed
  • lib/internal/Magento/Framework/File

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ public function __construct(TargetDirectory $targetDirectory = null)
3939
public function getNewFileName(string $destinationFile)
4040
{
4141
$fileInfo = $this->getPathInfo($destinationFile);
42-
if ($this->targetDirectory->getDirectoryWrite(DirectoryList::ROOT)->isExist($destinationFile)) {
42+
$directory = $this->targetDirectory->getDirectoryWrite(DirectoryList::ROOT);
43+
if ($directory->isExist($destinationFile)) {
4344
$index = 1;
4445
$baseName = $fileInfo['filename'] . '.' . $fileInfo['extension'];
45-
while ($this->targetDirectory->getDirectoryWrite(DirectoryList::ROOT)->isExist($fileInfo['dirname'] . '/' . $baseName)) {
46+
while ($directory->isExist($fileInfo['dirname'] . '/' . $baseName)) {
4647
$baseName = $fileInfo['filename'] . '_' . $index . '.' . $fileInfo['extension'];
4748
$index++;
4849
}

0 commit comments

Comments
 (0)