Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/private/Files/Storage/Wrapper/PermissionsMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@
#[\Override]
public function rename(string $source, string $target): bool {
//This is a rename of the transfer file to the original file
if (dirname($source) === dirname($target) && strpos($source, '.ocTransferId') > 0) {
return $this->checkMask(Constants::PERMISSION_CREATE) && parent::rename($source, $target);
$sourceDir = dirname($source);
$targetDir = dirname($target);
if (($sourceDir === $targetDir || $sourceDir === dirname($targetDir)) && strpos($source, '.ocTransferId') > 0) {
return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($source, $target);

Check failure on line 77 in lib/private/Files/Storage/Wrapper/PermissionsMask.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UnrecognizedExpression

lib/private/Files/Storage/Wrapper/PermissionsMask.php:77:11: UnrecognizedExpression: Logical binary operators AND and OR are not allowed in the Nextcloud codebase (see https://psalm.dev/048)
}
return $this->checkMask(Constants::PERMISSION_UPDATE) && parent::rename($source, $target);
}
Expand Down
Loading