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

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