[Pkg-owncloud-commits] [owncloud] 122/394: take root folder into account while checking for Shared folder

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:11:42 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit ea54fe98f729f371cfaec983d53d4c5d385a41c2
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Tue Nov 20 16:57:35 2012 +0100

    take root folder into account while checking for Shared folder
---
 lib/filecache.php |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/filecache.php b/lib/filecache.php
index 50990c3..abdf6c6 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -520,11 +520,15 @@ class OC_FileCache{
 	 * @return array with the path and the root of the give file
 	 */
 	private static function getSourcePathOfSharedFile($path, $root) {
-		if ( OC_App::isEnabled('files_sharing') &&  !strncmp($path, '/Shared/', 8)) {
-			$source = OC_Files_Sharing_Util::getSourcePath(str_replace('/Shared/', '', $path));
-			$parts = explode('/', $source, 4);
-			$root =  '/'.$parts[1].'/files';
-			$path = '/'.$parts[3];
+		if ( OC_App::isEnabled('files_sharing')) {
+			$fullPath = OC_Filesystem::normalizePath($root.'/'.$path);
+			$sharedPos =  strpos($fullPath, '/Shared/');
+			if ( $sharedPos !== false && ($source = OC_Files_Sharing_Util::getSourcePath(substr($fullPath, $sharedPos+8))) ) {
+				$source = OC_Files_Sharing_Util::getSourcePath(str_replace('/Shared/', '', $path));
+				$parts = explode('/', $source, 4);
+				$root =  '/'.$parts[1].'/files';
+				$path = '/'.$parts[3];
+			}
 		}
 		
 		return array($path, $root);

-- 
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