[Pkg-owncloud-commits] [owncloud] 75/107: Make AppManager->checkAppForUser more robust

David Prévot taffit at moszumanska.debian.org
Thu Dec 17 19:40:38 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 6cdf398a41e1dd7352582e97d85ce6eb8c9cafaf
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Thu Dec 10 14:53:34 2015 +0100

    Make AppManager->checkAppForUser more robust
    
    * if the JSON that is stored in the DB is corrupt an error was thrown
    * with this change it is properly handled and the app is disabled
---
 lib/private/app/appmanager.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php
index 8fb197e..a07b849 100644
--- a/lib/private/app/appmanager.php
+++ b/lib/private/app/appmanager.php
@@ -140,6 +140,13 @@ class AppManager implements IAppManager {
 			return false;
 		} else {
 			$groupIds = json_decode($enabled);
+
+			if (!is_array($groupIds)) {
+				$jsonError = json_last_error();
+				\OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']);
+				return false;
+			}
+
 			$userGroups = $this->groupManager->getUserGroupIds($user);
 			foreach ($userGroups as $groupId) {
 				if (array_search($groupId, $groupIds) !== false) {

-- 
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