Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 337-341 (lines=5) @@
334
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
335
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
336
			$excludedGroups = json_decode($groupsList);
337
			if (is_null($excludedGroups)) {
338
				$excludedGroups = explode(',', $groupsList);
339
				$newValue = json_encode($excludedGroups);
340
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
341
			}
342
			$usersGroups = $groupManager->getUserGroupIds($user);
343
			if (!empty($usersGroups)) {
344
				$remainingGroups = array_diff($usersGroups, $excludedGroups);

lib/private/Share20/Manager.php 1 location

@@ 1581-1585 (lines=5) @@
1578
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1579
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1580
			$excludedGroups = json_decode($groupsList);
1581
			if (is_null($excludedGroups)) {
1582
				$excludedGroups = explode(',', $groupsList);
1583
				$newValue = json_encode($excludedGroups);
1584
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1585
			}
1586
			$user = $this->userManager->get($userId);
1587
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1588
			if (!empty($usersGroups)) {