[Pkg-owncloud-commits] [owncloud] 08/63: fix internal path when searching in storage root (cherry picked from commit c2d76d2)

David Prévot taffit at moszumanska.debian.org
Tue Dec 22 16:50:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8.0
in repository owncloud.

commit 8db22f5d50373d6a991587c8547af6d8257ee3d8
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Oct 6 15:02:47 2015 +0200

    fix internal path when searching in storage root
    (cherry picked from commit c2d76d2)
---
 lib/private/files/node/folder.php | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/private/files/node/folder.php b/lib/private/files/node/folder.php
index cef5ef2..59f8424 100644
--- a/lib/private/files/node/folder.php
+++ b/lib/private/files/node/folder.php
@@ -259,14 +259,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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list