Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1276-1280 (lines=5) @@
1273
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1274
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1275
			$excludedGroups = json_decode($groupsList);
1276
			if (is_null($excludedGroups)) {
1277
				$excludedGroups = explode(',', $groupsList);
1278
				$newValue = json_encode($excludedGroups);
1279
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1280
			}
1281
			$user = $this->userManager->get($userId);
1282
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1283
			if (!empty($usersGroups)) {

lib/private/legacy/util.php 1 location

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