Skip to content

Commit

Permalink
Merge pull request #47581 from nextcloud/fix/audit-new-node
Browse files Browse the repository at this point in the history
fix: Do not fail to get internal path on NonExistingFile
  • Loading branch information
juliusknorr authored Aug 29, 2024
2 parents fef4295 + 6110888 commit 6d04ad8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/private/Files/Node/NonExistingFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public function getId() {
}
}

public function getInternalPath() {
if ($this->fileInfo) {
return parent::getInternalPath();
} else {
return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
}
}

public function stat() {
throw new NotFoundException();
}
Expand Down
8 changes: 8 additions & 0 deletions lib/private/Files/Node/NonExistingFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public function getId() {
}
}

public function getInternalPath() {
if ($this->fileInfo) {
return parent::getInternalPath();
} else {
return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
}
}

public function stat() {
throw new NotFoundException();
}
Expand Down

0 comments on commit 6d04ad8

Please sign in to comment.