Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 255-259 (lines=5) @@
252
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
253
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
254
			$excludedGroups = json_decode($groupsList);
255
			if (is_null($excludedGroups)) {
256
				$excludedGroups = explode(',', $groupsList);
257
				$newValue = json_encode($excludedGroups);
258
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
259
			}
260
			$usersGroups = $groupManager->getUserGroupIds($user);
261
			if (!empty($usersGroups)) {
262
				$remainingGroups = array_diff($usersGroups, $excludedGroups);

lib/private/Share20/Manager.php 1 location

@@ 1215-1219 (lines=5) @@
1212
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1213
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1214
			$excludedGroups = json_decode($groupsList);
1215
			if (is_null($excludedGroups)) {
1216
				$excludedGroups = explode(',', $groupsList);
1217
				$newValue = json_encode($excludedGroups);
1218
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1219
			}
1220
			$user = $this->userManager->get($userId);
1221
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1222
			if (!empty($usersGroups)) {