[Pkg-owncloud-commits] [owncloud] 70/215: Verify that the encryption module exists before setting it
David Prévot
taffit at moszumanska.debian.org
Tue May 5 01:01:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit a09df6d4538d1fb62992fb8a84219bf9a42c6257
Author: Joas Schilling <nickvergessen at owncloud.com>
Date: Thu Apr 16 17:37:31 2015 +0200
Verify that the encryption module exists before setting it
---
lib/private/encryption/manager.php | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/private/encryption/manager.php b/lib/private/encryption/manager.php
index 8e08050..c10867c 100644
--- a/lib/private/encryption/manager.php
+++ b/lib/private/encryption/manager.php
@@ -101,17 +101,17 @@ class Manager implements IManager {
throw new Exceptions\ModuleAlreadyExistsException($id, $displayName);
}
- $defaultEncryptionModuleId = $this->getDefaultEncryptionModuleId();
-
- if (empty($defaultEncryptionModuleId)) {
- $this->setDefaultEncryptionModule($id);
- }
-
$this->encryptionModules[$id] = [
'id' => $id,
'displayName' => $displayName,
'callback' => $callback,
];
+
+ $defaultEncryptionModuleId = $this->getDefaultEncryptionModuleId();
+
+ if (empty($defaultEncryptionModuleId)) {
+ $this->setDefaultEncryptionModule($id);
+ }
}
/**
@@ -182,6 +182,7 @@ class Manager implements IManager {
*/
public function setDefaultEncryptionModule($moduleId) {
try {
+ $this->getEncryptionModule($moduleId);
$this->config->setAppValue('core', 'default_encryption_module', $moduleId);
return true;
} catch (\Exception $e) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list