From: Thomas Müller Date: Wed, 4 Jun 2014 06:21:28 +0000 (+0200) Subject: workaround to get the unit test going X-Git-Tag: v7.0.0alpha2~127^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=917f389747dc3b8b3d5b9ff326a2cee21579f58a;p=nextcloud-server.git workaround to get the unit test going --- diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 8fae901fe63..d1ee4a97d15 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -99,12 +99,14 @@ class Hooks { // Set legacy encryption key if it exists, to support // depreciated encryption system - $encLegacyKey = $userView->file_get_contents('encryption.key'); - if ($encLegacyKey) { + if ($userView->file_exists('encryption.key')) { + $encLegacyKey = $userView->file_get_contents('encryption.key'); + if ($encLegacyKey) { - $plainLegacyKey = Crypt::legacyDecrypt($encLegacyKey, $params['password']); + $plainLegacyKey = Crypt::legacyDecrypt($encLegacyKey, $params['password']); - $session->setLegacyKey($plainLegacyKey); + $session->setLegacyKey($plainLegacyKey); + } } // Encrypt existing user files