diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-10-06 15:02:47 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-06 15:54:17 +0200 |
commit | c2d76d201075733a89d5167faf1091e589249a77 (patch) | |
tree | e541a132bb32740bf034597b7948fbc19aed8cfd /lib | |
parent | e28a2ff8882d4f0369cb32194975fc04a6080cb4 (diff) | |
download | nextcloud-server-c2d76d201075733a89d5167faf1091e589249a77.tar.gz nextcloud-server-c2d76d201075733a89d5167faf1091e589249a77.zip |
fix internal path when searching in storage root
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/node/folder.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/files/node/folder.php b/lib/private/files/node/folder.php index 00bf738227d..9032c2bfb9d 100644 --- a/lib/private/files/node/folder.php +++ b/lib/private/files/node/folder.php @@ -215,14 +215,17 @@ class Folder extends Node implements \OCP\Files\Folder { * @var \OC\Files\Storage\Storage $storage */ list($storage, $internalPath) = $this->view->resolvePath($this->path); - $internalPath = rtrim($internalPath, '/') . '/'; + $internalPath = rtrim($internalPath, '/'); + if ($internalPath !== '') { + $internalPath = $internalPath . '/'; + } $internalRootLength = strlen($internalPath); $cache = $storage->getCache(''); $results = call_user_func_array(array($cache, $method), $args); foreach ($results as $result) { - if ($internalRootLength === 1 or substr($result['path'], 0, $internalRootLength) === $internalPath) { + if ($internalRootLength === 0 or substr($result['path'], 0, $internalRootLength) === $internalPath) { $result['internalPath'] = $result['path']; $result['path'] = substr($result['path'], $internalRootLength); $result['storage'] = $storage; |