summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-08-05 13:32:26 +0200
committerRobin Appelman <icewind@owncloud.com>2016-08-05 14:06:05 +0200
commitf1cd68d71337d3419ea7fced7304bc2a763d29d4 (patch)
treec2f2aa5d7b2fd755e7333b6daa6ebc4461677e27 /lib/private/Files/Cache
parentd252d79059fd80e74754ef0fbbbba04fc3db2c91 (diff)
downloadnextcloud-server-f1cd68d71337d3419ea7fced7304bc2a763d29d4.tar.gz
nextcloud-server-f1cd68d71337d3419ea7fced7304bc2a763d29d4.zip
Adding test case for getPathById including a jailed cache where root is just empty
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 90226e56144..1196c6b0760 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -59,6 +59,9 @@ class CacheJail extends CacheWrapper {
* @return null|string the jailed path or null if the path is outside the jail
*/
protected function getJailedPath($path) {
+ if ($this->root === '') {
+ return $path;
+ }
$rootLength = strlen($this->root) + 1;
if ($path === $this->root) {
return '';
@@ -290,7 +293,6 @@ class CacheJail extends CacheWrapper {
*/
public function getPathById($id) {
$path = $this->cache->getPathById($id);
- $path = $this->getSourcePath($path);
return $this->getJailedPath($path);
}