Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1526-1530 (lines=5) @@
1523
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1524
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1525
			$excludedGroups = json_decode($groupsList);
1526
			if (is_null($excludedGroups)) {
1527
				$excludedGroups = explode(',', $groupsList);
1528
				$newValue = json_encode($excludedGroups);
1529
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1530
			}
1531
			$user = $this->userManager->get($userId);
1532
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1533
			if (!empty($usersGroups)) {

lib/private/legacy/util.php 1 location

@@ 318-322 (lines=5) @@
315
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
316
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
317
			$excludedGroups = json_decode($groupsList);
318
			if (is_null($excludedGroups)) {
319
				$excludedGroups = explode(',', $groupsList);
320
				$newValue = json_encode($excludedGroups);
321
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
322
			}
323
			$usersGroups = $groupManager->getUserGroupIds($user);
324
			if (!empty($usersGroups)) {
325
				$remainingGroups = array_diff($usersGroups, $excludedGroups);