mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
handle error if we can't handle the given path
This commit is contained in:
parent
a6ced6b53f
commit
a212c98125
2 changed files with 7 additions and 2 deletions
|
|
@ -201,7 +201,7 @@ class Helper {
|
|||
$split = explode('/', $trimmed);
|
||||
|
||||
// it is not a file relative to data/user/files
|
||||
if ($split[1] !== 'files') {
|
||||
if (count($split) < 3 || $split[1] !== 'files') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ class Helper {
|
|||
$trimmed = ltrim($path, '/');
|
||||
$split = explode('/', $trimmed);
|
||||
|
||||
if ($split[1] !== "files_versions") {
|
||||
if (count($split) < 3 || $split[1] !== "files_versions") {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ class Stream {
|
|||
$this->relPath = Helper::getPathToRealFile($this->rawPath);
|
||||
}
|
||||
|
||||
if($this->relPath === false) {
|
||||
\OCP\Util::writeLog('Encryption library', 'failed to open file "' . $this->rawPath . '" expecting a path to user/files or to user/files_versions', \OCP\Util::ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disable fileproxies so we can get the file size and open the source file without recursive encryption
|
||||
$proxyStatus = \OC_FileProxy::$enabled;
|
||||
\OC_FileProxy::$enabled = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue