summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-24 10:25:00 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-24 10:25:00 +0200
commitdf75c17e52001f2d59e72df132743e289c10809e (patch)
treef956720a2ea107def8c2f51d7c748816399dad70 /lib/private/files
parent158c962fcc15455085751d8e2dfbf668c7615ba9 (diff)
parentd26c49b995ef3a574d7239388b97b4cdd0c747e8 (diff)
downloadnextcloud-server-df75c17e52001f2d59e72df132743e289c10809e.tar.gz
nextcloud-server-df75c17e52001f2d59e72df132743e289c10809e.zip
Merge pull request #16479 from owncloud/core-fixgetrelativepathwrongmatches
Prevent wrong matches in getRelativePath
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/view.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index f92441492f7..95b688fef5c 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -153,7 +153,10 @@ class View {
return '/';
}
- if (strpos($path, $this->fakeRoot) !== 0) {
+ // missing slashes can cause wrong matches!
+ $root = rtrim($this->fakeRoot, '/') . '/';
+
+ if (strpos($path, $root) !== 0) {
return null;
} else {
$path = substr($path, strlen($this->fakeRoot));