Skip to content

Check share status when touching versions - #43727

Merged
artonge merged 5 commits into
masterfrom
artonge/fix/prevent_download_of_shares
Feb 21, 2024
Merged

Check share status when touching versions#43727
artonge merged 5 commits into
masterfrom
artonge/fix/prevent_download_of_shares

Conversation

@artonge

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artongeartonge self-assigned this Feb 21, 2024
@artongeartonge added 3. to review Waiting for reviews feature: versions javascript php Pull requests that update Php code labels Feb 21, 2024
@artongeartonge added this to the Nextcloud 29 milestone Feb 21, 2024
@artonge
artonge marked this pull request as ready for review February 21, 2024 15:11
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable28

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable27

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable26

@artonge
artongeforce-pushed the artonge/fix/prevent_download_of_shares branch from d4726e9 to 7f6ff98CompareFebruary 21, 2024 15:12
$currentUserId = $this->userFolder?->getOwner()?->getUID();
// The version source file is relative to the owner storage.
// But we need the node from the current user perspective.
if ($node->getOwner()->getUID() !== $currentUserId) {

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getUID on possibly null value
// The version source file is relative to the owner storage.
// But we need the node from the current user perspective.
if ($node->getOwner()->getUID() !== $currentUserId) {
$nodes = $this->userFolder->getById($node->getId());

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getById on possibly null value
// The version source file is relative to the owner storage.
// But we need the node from the current user perspective.
if ($node->getOwner()->getUID() !== $currentUserId) {
$nodes = $this->userFolder->getById($node->getId());

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of OCP\Files\Folder::getById cannot be null, possibly null value provided
// Allow view-only plugin for webdav requests
$this->server->addPlugin(new ViewOnlyPlugin(
$logger
\OC::$server->getUserFolder(),

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getUserFolder has been marked as deprecated
}

if ($sourceFile->getOwner()?->getUID() !== $currentUserId) {
$nodes = $this->rootFolder->getUserFolder($currentUserId)->getById($sourceFile->getId());

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of OCP\Files\Folder::getById cannot be null, possibly null value provided
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
artongeforce-pushed the artonge/fix/prevent_download_of_shares branch from 7f6ff98 to 18b32e8CompareFebruary 21, 2024 15:48
Comment threadapps/files_versions/src/components/Version.vue
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport 8e95d0f to stable25

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport 741dec237d0fd1 to stable25

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport 741dec237d0fd1 to stable24

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport 741dec237d0fd1 to stable23

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsfeature: versionsjavascriptphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@artonge@susnux@skjnldsv@github-advanced-security