diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-01-29 08:43:17 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-01-29 08:43:17 +0100 |
commit | 39a4b1c4011ba9b9f5c88679baadd79c8d1cf343 (patch) | |
tree | 07b807c1013d5a4f946993325081396e74e30811 /lib/private | |
parent | 395826b81afd148bdd45588892f6614225f38d14 (diff) | |
download | nextcloud-server-39a4b1c4011ba9b9f5c88679baadd79c8d1cf343.tar.gz nextcloud-server-39a4b1c4011ba9b9f5c88679baadd79c8d1cf343.zip |
Normalize compared path to avoid renaming to the same directory
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Template/TemplateManager.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index 813f3fe83e9..277411279f6 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -28,6 +28,7 @@ namespace OC\Files\Template; use OC\AppFramework\Bootstrap\Coordinator; use OC\Files\Cache\Scanner; +use OC\Files\Filesystem; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Folder; use OCP\Files\File; @@ -272,7 +273,7 @@ class TemplateManager implements ITemplateManager { if (!$userFolder->nodeExists('Templates')) { return ''; } - $newPath = $userFolder->getPath() . '/' . $userTemplatePath; + $newPath = Filesystem::normalizePath($userFolder->getPath() . '/' . $userTemplatePath); if ($newPath !== $userFolder->get('Templates')->getPath()) { $userFolder->get('Templates')->move($newPath); } |