diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-17 09:19:17 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-17 09:19:17 +0200 |
commit | 77d6d11b91eb975e451fc1ea3aa870cfee5707a1 (patch) | |
tree | 799ce4cceb9bff5b061173c674849ee4035be853 | |
parent | b736864e78508a049638a2621cc3104af0f6d1d5 (diff) | |
parent | 5a0397eb5e10ebc5a43e4a034dae4eb4b227b8ac (diff) | |
download | nextcloud-server-77d6d11b91eb975e451fc1ea3aa870cfee5707a1.tar.gz nextcloud-server-77d6d11b91eb975e451fc1ea3aa870cfee5707a1.zip |
Merge pull request #9682 from owncloud/mappedlocal-rename
Fix renaming files in the root folder of a MappedLocal storage
-rw-r--r-- | lib/private/files/storage/mappedlocal.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php index 6910eef7401..c4a8dc1961c 100644 --- a/lib/private/files/storage/mappedlocal.php +++ b/lib/private/files/storage/mappedlocal.php @@ -184,8 +184,8 @@ class MappedLocal extends \OC\Files\Storage\Common { } public function rename($path1, $path2) { - $srcParent = dirname($path1); - $dstParent = dirname($path2); + $srcParent = $this->dirname($path1); + $dstParent = $this->dirname($path2); if (!$this->isUpdatable($srcParent)) { \OC_Log::write('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OC_Log::ERROR); @@ -355,6 +355,8 @@ class MappedLocal extends \OC\Files\Storage\Common { /** * @param string $path + * @param bool $create + * @return string */ private function buildPath($path, $create = true) { $path = $this->stripLeading($path); @@ -364,6 +366,19 @@ class MappedLocal extends \OC\Files\Storage\Common { /** * @param string $path + * @return string + */ + private function dirName($path) { + $path = dirname($path); + if ($path === '.') { + return ''; + } else { + return $path; + } + } + + /** + * @param string $path */ private function cleanMapper($path, $isLogicPath = true, $recursive=true) { $fullPath = $path; |