fix internal path when searching in storage root
This commit is contained in:
parent
e28a2ff888
commit
c2d76d2010
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue