summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-24 11:59:03 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-24 11:59:03 -0400
commit4c4b1e4c2d7a5ffa2131646d70c495b51b5c9013 (patch)
tree244c48c6b7113a7e28278d9b5d310a057b52942d
parent4028dc984afc549ec5c5f50ee0634e908bb1dbc7 (diff)
downloadnextcloud-server-4c4b1e4c2d7a5ffa2131646d70c495b51b5c9013.tar.gz
nextcloud-server-4c4b1e4c2d7a5ffa2131646d70c495b51b5c9013.zip
Clear the folder size cache for the 'Shared' folder when a new item is shared
-rw-r--r--apps/files_sharing/lib_share.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index dd73a20051f..c862f505e42 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -66,7 +66,8 @@ class OC_Share {
throw new Exception("This item is already shared with ".$uid);
}
// Check if the target already exists for the user, if it does append a number to the name
- $target = "/".$uid."/files/Shared/".basename($source);
+ $sharedFolder = "/".$uid."/files/Shared";
+ $target = $sharedFolder."/".basename($source);
if (self::getSource($target)) {
if ($pos = strrpos($target, ".")) {
$name = substr($target, 0, $pos);
@@ -87,6 +88,9 @@ class OC_Share {
$uid = $uid."@".$gid;
}
$query->execute(array($uid_owner, $uid, $source, $target, $permissions));
+ // Clear the folder size cache for the 'Shared' folder
+ $clearFolderSize = OC_DB::prepare("DELETE FROM *PREFIX*foldersize WHERE path = ?");
+ $clearFolderSize->execute(array($sharedFolder));
}
}
}