Skip to content

Commit

Permalink
Merge pull request #9 from Zheness/patch-1
Browse files Browse the repository at this point in the history
Update File.php
  • Loading branch information
moufmouf authored Aug 1, 2018
2 parents 1bcbe0d + ff80451 commit 8d86abc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mouf/Html/Widgets/JqueryFileUpload/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function rename($newFileName, $mode = RenameEnum::MOVE) {
if ($mode === RenameEnum::MOVE_AND_RENAME) {
$targetFileName = $this->getTargetName($this->directory, $newFileName);
} else {
$targetFileName = $this->fileName;
$targetFileName = $newFileName;
}

$fs->rename($this->directory.'/'.$this->fileName, $this->directory.'/'.$targetFileName, $mode === RenameEnum::MOVE_AND_OVERWRITE);
Expand All @@ -109,7 +109,7 @@ public function moveAndRename($targetDir, $newFileName, $mode = RenameEnum::MOVE
if ($mode === RenameEnum::MOVE_AND_RENAME) {
$targetFileName = $this->getTargetName($targetDir, $newFileName);
} else {
$targetFileName = $this->fileName;
$targetFileName = $newFileName;
}

$fs->rename($this->directory.'/'.$this->fileName, $targetDir.'/'.$targetFileName, $mode === RenameEnum::MOVE_AND_OVERWRITE);
Expand Down

0 comments on commit 8d86abc

Please sign in to comment.