summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-18 12:51:16 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-23 16:33:28 +0200
commitdd972f65a8271ddcc4d253e87f9dbaeaba95941f (patch)
treeb3186aecfce7eac936aa9e914275d942979ed98b
parentefdbcbddef2d1bf018a24ddc1837475fb9301b79 (diff)
downloadnextcloud-server-dd972f65a8271ddcc4d253e87f9dbaeaba95941f.tar.gz
nextcloud-server-dd972f65a8271ddcc4d253e87f9dbaeaba95941f.zip
fix infinite loop while updating etags, fix for #4365
-rw-r--r--apps/files_sharing/lib/updater.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index 08aaa62e252..8945da41e3d 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -32,17 +32,19 @@ class Shared_Updater {
$uid = \OCP\User::getUser();
$uidOwner = \OC\Files\Filesystem::getOwner($target);
$info = \OC\Files\Filesystem::getFileInfo($target);
+ $currentOwner = $uidOwner;
// Correct Shared folders of other users shared with
- $users = \OCP\Share::getUsersItemShared('file', $info['fileid'], $uidOwner, true);
+ $users = \OCP\Share::getUsersItemShared('file', $info['fileid'], $currentOwner, true);
if (!empty($users)) {
while (!empty($users)) {
$reshareUsers = array();
foreach ($users as $user) {
- if ( $user !== $uidOwner ) {
+ if ( $user !== $currentOwner ) {
$etag = \OC\Files\Filesystem::getETag('');
\OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
// Look for reshares
$reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
+ $currentOwner = $user;
}
}
$users = $reshareUsers;