Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 327-331 (lines=5) @@
324
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
325
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
326
			$excludedGroups = \json_decode($groupsList);
327
			if ($excludedGroups === null) {
328
				$excludedGroups = \explode(',', $groupsList);
329
				$newValue = \json_encode($excludedGroups);
330
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
331
			}
332
			$usersGroups = $groupManager->getUserGroupIds($user);
333
			if (!empty($usersGroups)) {
334
				$remainingGroups = \array_diff($usersGroups, $excludedGroups);

lib/private/Share20/Manager.php 1 location

@@ 1412-1416 (lines=5) @@
1409
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1410
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1411
			$excludedGroups = \json_decode($groupsList);
1412
			if ($excludedGroups === null) {
1413
				$excludedGroups = \explode(',', $groupsList);
1414
				$newValue = \json_encode($excludedGroups);
1415
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1416
			}
1417
			$user = $this->userManager->get($userId);
1418
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1419
			if (!empty($usersGroups)) {