Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1243-1247 (lines=5) @@
1240
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1241
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1242
			$excludedGroups = json_decode($groupsList);
1243
			if (is_null($excludedGroups)) {
1244
				$excludedGroups = explode(',', $groupsList);
1245
				$newValue = json_encode($excludedGroups);
1246
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1247
			}
1248
			$user = $this->userManager->get($userId);
1249
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1250
			if (!empty($usersGroups)) {

lib/private/legacy/util.php 1 location

@@ 263-267 (lines=5) @@
260
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
261
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
262
			$excludedGroups = json_decode($groupsList);
263
			if (is_null($excludedGroups)) {
264
				$excludedGroups = explode(',', $groupsList);
265
				$newValue = json_encode($excludedGroups);
266
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
267
			}
268
			$usersGroups = $groupManager->getUserGroupIds($user);
269
			if (!empty($usersGroups)) {
270
				$remainingGroups = array_diff($usersGroups, $excludedGroups);