Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 265-269 (lines=5) @@
262
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
263
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
264
			$excludedGroups = json_decode($groupsList);
265
			if (is_null($excludedGroups)) {
266
				$excludedGroups = explode(',', $groupsList);
267
				$newValue = json_encode($excludedGroups);
268
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
269
			}
270
			$usersGroups = $groupManager->getUserGroupIds($user);
271
			if (!empty($usersGroups)) {
272
				$remainingGroups = array_diff($usersGroups, $excludedGroups);

lib/private/Share20/Manager.php 1 location

@@ 1315-1319 (lines=5) @@
1312
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1313
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1314
			$excludedGroups = json_decode($groupsList);
1315
			if (is_null($excludedGroups)) {
1316
				$excludedGroups = explode(',', $groupsList);
1317
				$newValue = json_encode($excludedGroups);
1318
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1319
			}
1320
			$user = $this->userManager->get($userId);
1321
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1322
			if (!empty($usersGroups)) {