Merge pull request #21119 from owncloud/make-appconfig-more-robust

Make AppManager->checkAppForUser more robust
This commit is contained in:
Thomas Müller 2015-12-10 16:44:40 +01:00
commit ab1ea5ccc4
1 changed files with 7 additions and 0 deletions

View File

@ -148,6 +148,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) {