diff options
author | Robin Appelman <robin@icewind.nl> | 2020-06-11 15:22:59 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-06-24 22:08:42 +0300 |
commit | a2ebe6d30ef7c59cfd1851b367e8c48f28d5823a (patch) | |
tree | c5571a2398ee6090571796a7c8bb419551186776 /lib | |
parent | 3a59ea88a8fdefe079dcb31f196586a514df4da1 (diff) |
relax permissions mask check for detecting part file rename
with files drop uploads the original file name isn't always used for the '.ocTransferId' source path
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/PermissionsMask.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php index c2cea31bd5a..fd6e52402d7 100644 --- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php @@ -80,13 +80,9 @@ class PermissionsMask extends Wrapper { } public function rename($path1, $path2) { - $p = strpos($path1, $path2); - if ($p === 0) { - $part = substr($path1, strlen($path2)); - //This is a rename of the transfer file to the original file - if (strpos($part, '.ocTransferId') === 0) { - return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2); - } + //This is a rename of the transfer file to the original file + if (dirname($path1) === dirname($path2) && strpos($path1, '.ocTransferId') > 0) { + return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2); } return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2); } |