diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-10 15:02:52 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-10 15:02:52 +0200 |
commit | 909af2b62e75d1a5db866466074f2bcb95b864dc (patch) | |
tree | 20ad4f989f49937cdb6a6c44eb5db8df263ece1e /apps | |
parent | a1719deabed4296c7daec51d926640100ac94980 (diff) | |
download | nextcloud-server-909af2b62e75d1a5db866466074f2bcb95b864dc.tar.gz nextcloud-server-909af2b62e75d1a5db866466074f2bcb95b864dc.zip |
don't cache if the encryption is enabled, this can lead to problems during unit testing
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 6f630c83a3f..8621c1ba51d 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -38,8 +38,6 @@ class Proxy extends \OC_FileProxy { private static $blackList = null; //mimetypes blacklisted from encryption - private static $enableEncryption = null; - /** * Check if a file requires encryption * @param string $path @@ -49,46 +47,22 @@ class Proxy extends \OC_FileProxy { */ private static function shouldEncrypt($path) { - if (is_null(self::$enableEncryption)) { - if ( - \OCP\App::isEnabled('files_encryption') === true - && Crypt::mode() === 'server' - ) { - - self::$enableEncryption = true; - - } else { - - self::$enableEncryption = false; - - } - - } - - if (!self::$enableEncryption) { - + if (\OCP\App::isEnabled('files_encryption') === false || Crypt::mode() !== 'server') { return false; - } if (is_null(self::$blackList)) { - self::$blackList = explode(',', \OCP\Config::getAppValue('files_encryption', 'type_blacklist', '')); - } if (Crypt::isCatfileContent($path)) { - return true; - } $extension = substr($path, strrpos($path, '.') + 1); if (array_search($extension, self::$blackList) === false) { - return true; - } return false; |