Merge pull request #16632 from nextcloud/bugfix/external-reshare
Set proper root path for single file shares originating from other storages
This commit is contained in:
commit
e0d767d3e1
|
@ -244,7 +244,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
}
|
||||
|
||||
public function fopen($path, $mode) {
|
||||
if ($source = $this->getUnjailedPath($path)) {
|
||||
$source = $this->getUnjailedPath($path);
|
||||
switch ($mode) {
|
||||
case 'r+':
|
||||
case 'rb+':
|
||||
|
@ -294,8 +294,6 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
\OCP\Util::emitHook('\OC\Files\Storage\Shared', 'fopen', $info);
|
||||
return $this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* see http://php.net/manual/en/function.rename.php
|
||||
|
|
|
@ -56,11 +56,7 @@ class Jail extends Wrapper {
|
|||
}
|
||||
|
||||
public function getUnjailedPath($path) {
|
||||
if ($path === '') {
|
||||
return $this->rootPath;
|
||||
} else {
|
||||
return Filesystem::normalizePath($this->rootPath . '/' . $path);
|
||||
}
|
||||
return trim(Filesystem::normalizePath($this->rootPath . '/' . $path), '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue