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
			$matchingGroups = \array_intersect($usersGroups, $excludedGroups);
334
			if (!empty($matchingGroups)) {

lib/private/Share20/Manager.php 1 location

@@ 1501-1505 (lines=5) @@
1498
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1499
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1500
			$excludedGroups = \json_decode($groupsList);
1501
			if ($excludedGroups === null) {
1502
				$excludedGroups = \explode(',', $groupsList);
1503
				$newValue = \json_encode($excludedGroups);
1504
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1505
			}
1506
			$user = $this->userManager->get($userId);
1507
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1508
			$matchingGroups = \array_intersect($usersGroups, $excludedGroups);