Skip to content

Commit

Permalink
Merge pull request #280 from durasj/php-local-bridge-june-update
Browse files Browse the repository at this point in the history
Fixes extension dot (.ext) to be replaced with dash (-ext)
  • Loading branch information
joni2back committed Jun 8, 2017
2 parents 5962af1 + 0366ba8 commit d9735de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bridges/php-local/LocalBridge/FileManagerApi.php
Expand Up @@ -264,9 +264,12 @@ private function uploadAction($path, $files)
$path = $this->canonicalizePath($this->basePath . $path);

foreach ($_FILES as $file) {
$fileInfo = pathinfo($file['name']);
$fileName = $this->normalizeName($fileInfo['filename']) . '.' . $fileInfo['extension'];

$uploaded = move_uploaded_file(
$file['tmp_name'],
$path . DIRECTORY_SEPARATOR . $this->normalizeName($file['name'])
$path . DIRECTORY_SEPARATOR . $fileName
);
if ($uploaded === false) {
return false;
Expand Down

0 comments on commit d9735de

Please sign in to comment.