]> source.dussan.org Git - nextcloud-server.git/commitdiff
always check for unique filename, if a file gets added from outside the mount
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 22 May 2014 12:29:23 +0000 (14:29 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 22 May 2014 12:31:22 +0000 (14:31 +0200)
point should be adjusted to ne unique again

apps/files_sharing/lib/sharedstorage.php

index 07a0acf00a5257b078bfa5d435252602b48fb3ce..02a8ebab93ac2dca995879c9c1ecd0a4f1ed2238 100644 (file)
@@ -517,14 +517,14 @@ class Shared extends \OC\Files\Storage\Common {
                        $parent = dirname($parent);
                }
 
-               $newMountPoint = \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint);
+               $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget(
+                               \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint),
+                               array(),
+                               new \OC\Files\View('/' . \OCP\User::getUser() . '/files')
+                               );
 
                if($newMountPoint !== $share['file_target']) {
-                       $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget(
-                                       $newMountPoint,
-                                       array(),
-                                       new \OC\Files\View('/' . \OCP\User::getUser() . '/files')
-                                       );
+
                        self::updateFileTarget($newMountPoint, $share);
                        $share['file_target'] = $newMountPoint;