Skip to content

Commit d9735de

Browse files
authored
Merge pull request joni2back#280 from durasj/php-local-bridge-june-update
Fixes extension dot (.ext) to be replaced with dash (-ext)
2 parents 5962af1 + 0366ba8 commit d9735de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bridges/php-local/LocalBridge/FileManagerApi.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,12 @@ private function uploadAction($path, $files)
264264
$path = $this->canonicalizePath($this->basePath . $path);
265265

266266
foreach ($_FILES as $file) {
267+
$fileInfo = pathinfo($file['name']);
268+
$fileName = $this->normalizeName($fileInfo['filename']) . '.' . $fileInfo['extension'];
269+
267270
$uploaded = move_uploaded_file(
268271
$file['tmp_name'],
269-
$path . DIRECTORY_SEPARATOR . $this->normalizeName($file['name'])
272+
$path . DIRECTORY_SEPARATOR . $fileName
270273
);
271274
if ($uploaded === false) {
272275
return false;

0 commit comments

Comments
 (0)