From 6dc8922d0799530617c533d0d736b4aafb4d2b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 15 Feb 2024 11:27:05 +0100 Subject: [PATCH] fix: Use existing name to construct new file path based on extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/WopiController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index b0cd3def..311c5014 100755 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -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 {