File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
app/code/Magento/Customer/Model/Metadata/Form Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments