Skip to content

Commit

Permalink
fix: Use existing name to construct new file path based on extension
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Feb 15, 2024
1 parent af93bc1 commit 6dc8922
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ public function putFile($fileId,
$suggested = iconv('utf-7', 'utf-8', $suggested);

if ($suggested[0] === '.') {
$path = dirname($file->getPath()) . '/New File' . $suggested;
$rawName = pathinfo($file->getName(), PATHINFO_FILENAME);
$path = dirname($file->getPath()) . '/' . $rawName . $suggested;
} elseif ($suggested[0] !== '/') {
$path = dirname($file->getPath()) . '/' . $suggested;
} else {
Expand Down

0 comments on commit 6dc8922

Please sign in to comment.