Normalize compared path to avoid renaming to the same directory
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
395826b81a
commit
39a4b1c401
|
@ -28,6 +28,7 @@ namespace OC\Files\Template;
|
||||||
|
|
||||||
use OC\AppFramework\Bootstrap\Coordinator;
|
use OC\AppFramework\Bootstrap\Coordinator;
|
||||||
use OC\Files\Cache\Scanner;
|
use OC\Files\Cache\Scanner;
|
||||||
|
use OC\Files\Filesystem;
|
||||||
use OCP\EventDispatcher\IEventDispatcher;
|
use OCP\EventDispatcher\IEventDispatcher;
|
||||||
use OCP\Files\Folder;
|
use OCP\Files\Folder;
|
||||||
use OCP\Files\File;
|
use OCP\Files\File;
|
||||||
|
@ -272,7 +273,7 @@ class TemplateManager implements ITemplateManager {
|
||||||
if (!$userFolder->nodeExists('Templates')) {
|
if (!$userFolder->nodeExists('Templates')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
$newPath = $userFolder->getPath() . '/' . $userTemplatePath;
|
$newPath = Filesystem::normalizePath($userFolder->getPath() . '/' . $userTemplatePath);
|
||||||
if ($newPath !== $userFolder->get('Templates')->getPath()) {
|
if ($newPath !== $userFolder->get('Templates')->getPath()) {
|
||||||
$userFolder->get('Templates')->move($newPath);
|
$userFolder->get('Templates')->move($newPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue