aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-08-29 15:43:21 +0200
committerGitHub <noreply@github.com>2024-08-29 15:43:21 +0200
commit6d04ad829b2814090301b0101dc10fa0617dd783 (patch)
tree64e728b52c732deb20638bdd9551f0273318f3af
parentfef4295ef77f560b8cbdd1908a549d45cdbee239 (diff)
parent61108882b9405bbd3f69213e430201e37e32631b (diff)
downloadnextcloud-server-6d04ad829b2814090301b0101dc10fa0617dd783.tar.gz
nextcloud-server-6d04ad829b2814090301b0101dc10fa0617dd783.zip
Merge pull request #47581 from nextcloud/fix/audit-new-node
fix: Do not fail to get internal path on NonExistingFile
-rw-r--r--lib/private/Files/Node/NonExistingFile.php8
-rw-r--r--lib/private/Files/Node/NonExistingFolder.php8
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/Files/Node/NonExistingFile.php b/lib/private/Files/Node/NonExistingFile.php
index d154876432e..66ec2e6c040 100644
--- a/lib/private/Files/Node/NonExistingFile.php
+++ b/lib/private/Files/Node/NonExistingFile.php
@@ -38,6 +38,14 @@ class NonExistingFile extends File {
}
}
+ public function getInternalPath() {
+ if ($this->fileInfo) {
+ return parent::getInternalPath();
+ } else {
+ return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
+ }
+ }
+
public function stat() {
throw new NotFoundException();
}
diff --git a/lib/private/Files/Node/NonExistingFolder.php b/lib/private/Files/Node/NonExistingFolder.php
index 5650c99fe73..4489fdaf010 100644
--- a/lib/private/Files/Node/NonExistingFolder.php
+++ b/lib/private/Files/Node/NonExistingFolder.php
@@ -38,6 +38,14 @@ class NonExistingFolder extends Folder {
}
}
+ public function getInternalPath() {
+ if ($this->fileInfo) {
+ return parent::getInternalPath();
+ } else {
+ return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
+ }
+ }
+
public function stat() {
throw new NotFoundException();
}