Skip to content

Commit 430b90d

Browse files
committed
MC-40439: Update 2.4.3 branches with 2.4.2 branches
1 parent 4404075 commit 430b90d

File tree

1 file changed

+12
-1
lines changed
  • app/code/Magento/Customer/Model/Metadata/Form

1 file changed

+12
-1
lines changed

app/code/Magento/Customer/Model/Metadata/Form/File.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ private function getFileExtension(string $fileName): string
232232
return pathinfo($fileName, PATHINFO_EXTENSION);
233233
}
234234

235+
/**
236+
* Get file basename from the file if it exists, otherwise, get from filename.
237+
*
238+
* @param string $fileName
239+
* @return string
240+
*/
241+
private function getFileBasename(string $fileName): string
242+
{
243+
return pathinfo($fileName, PATHINFO_BASENAME);
244+
}
245+
235246
/**
236247
* Helper function that checks if the file was uploaded.
237248
*
@@ -248,7 +259,7 @@ protected function _isUploadedFile($filename)
248259
}
249260

250261
// This case is required for file uploader UI component
251-
$temporaryFile = FileProcessor::TMP_DIR . '/' . $this->fileProcessor->getStat($filename)['basename'];
262+
$temporaryFile = FileProcessor::TMP_DIR . '/' . $this->getFileBasename($filename);
252263
if ($this->fileProcessor->isExist($temporaryFile)) {
253264
return true;
254265
}

0 commit comments

Comments
 (0)