Skip to content
Snippets Groups Projects
Commit d36a2c8b authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #13285 from owncloud/fix-encryption-check-number-of-parts

Check array size, before using the 3rd element from it
parents 58b985b4 5c03e220
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,15 @@ class Proxy extends \OC_FileProxy {
$parts = explode('/', $path);
// we only encrypt/decrypt files in the files and files_versions folder
if (sizeof($parts) < 3) {
/**
* Less then 3 parts means, we can't match:
* - /{$uid}/files/* nor
* - /{$uid}/files_versions/*
* So this is not a path we are looking for.
*/
return true;
}
if(
strpos($path, '/' . $uid . '/files/') !== 0 &&
!($parts[2] === 'files_versions' && \OCP\User::userExists($parts[1]))) {
......
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