From 494d88a4353799ae2fbc2631578664715c063c7e Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind1991@gmail.com>
Date: Sun, 3 Oct 2010 23:07:55 +0000
Subject: [PATCH] fix bug in detecting mountpoints of file storages within
 chrooted filesystem

---
 inc/lib_filesystem.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/inc/lib_filesystem.php b/inc/lib_filesystem.php
index c8cbd1cb80..60201825e0 100644
--- a/inc/lib_filesystem.php
+++ b/inc/lib_filesystem.php
@@ -169,9 +169,15 @@ class OC_FILESYSTEM{
 		if(substr($path,0,1)!=='/'){
 			$path='/'.$path;
 		}
+		if(substr($path,-1)!=='/'){
+			$path=$path.'/';
+		}
 		$path=self::$fakeRoot.$path;
 		$foundMountPoint='';
 		foreach(self::$storages as $mountpoint=>$storage){
+			if(substr($mountpoint,-1)!=='/'){
+				$mountpoint=$mountpoint.'/';
+			}
 			if($mountpoint==$path){
 				return $mountpoint;
 			}
-- 
GitLab