Prevent searching for user directory in getParentFolders()

This commit is contained in:
Michael Gapczynski 2011-07-08 15:23:41 -04:00
parent f1cac00396
commit 73bab46758
1 changed files with 3 additions and 2 deletions

View File

@ -148,8 +148,9 @@ class OC_SHARE {
} else {
$query = OC_DB::prepare("SELECT source FROM *PREFIX*sharing WHERE target = ? AND uid_shared_with = ? LIMIT 1");
}
// TODO Prevent searching for user directory e.g. '/MTGap/files'
while ($path != "" && $path != "/" && $path != ".") {
// Prevent searching for user directory e.g. '/MTGap/files'
$userDirectory = substr($path, 0, strpos($path, "files") + 5);
while ($path != "" && $path != "/" && $path != "." && $path != $userDirectory) {
$result = $query->execute(array($path, $_SESSION['user_id']))->fetchAll();
if (count($result) > 0) {
break;