Skip to content

Commit

Permalink
Merge pull request #47625 from nextcloud/backport/47581/stable30
Browse files Browse the repository at this point in the history
[stable30] fix: Do not fail to get internal path on NonExistingFile
  • Loading branch information
AndyScherzinger authored Sep 2, 2024
2 parents a484760 + 2e312e4 commit 073b792
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 073b792

Please sign in to comment.