Skip to content
Snippets Groups Projects
Commit a212c981 authored by Björn Schießle's avatar Björn Schießle
Browse files

handle error if we can't handle the given path

parent a6ced6b5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment