diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-04-12 16:04:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 16:04:03 +0200 |
commit | dccb8928a11fd572337d8b6ff5987cb411172276 (patch) | |
tree | 37d47b0facb1c1c82800a570d75f5ad8b1308a03 /lib | |
parent | b90e91144bc8d378f6f52025f04383ae2e7c647b (diff) | |
parent | 30817fa319a3d5d7e4b64f774a8a02c1e9578d41 (diff) | |
download | nextcloud-server-dccb8928a11fd572337d8b6ff5987cb411172276.tar.gz nextcloud-server-dccb8928a11fd572337d8b6ff5987cb411172276.zip |
Merge pull request #4325 from nextcloud/downstream-27522
Optimize put - Dont try to fetch filecache for not existing filecache…
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index c0ccd22d147..793849914d7 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -910,7 +910,8 @@ class Encryption extends Wrapper { */ protected function getHeader($path) { $realFile = $this->util->stripPartialFileExtension($path); - if ($this->storage->file_exists($realFile)) { + $exists = $this->storage->file_exists($realFile); + if ($exists) { $path = $realFile; } @@ -922,8 +923,9 @@ class Encryption extends Wrapper { if (!isset($result[Util::HEADER_ENCRYPTION_MODULE_KEY])) { if (!empty($result)) { $result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE'; - } else { + } else if ($exists) { // if the header was empty we have to check first if it is a encrypted file at all + // We would do query to filecache only if we know that entry in filecache exists $info = $this->getCache()->get($path); if (isset($info['encrypted']) && $info['encrypted'] === true) { $result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE'; |