Code Duplication    Length = 5-5 lines in 2 locations

lib/private/util.php 1 location

@@ 248-252 (lines=5) @@
245
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
246
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
247
			$excludedGroups = json_decode($groupsList);
248
			if (is_null($excludedGroups)) {
249
				$excludedGroups = explode(',', $groupsList);
250
				$newValue = json_encode($excludedGroups);
251
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
252
			}
253
			$usersGroups = $groupManager->getUserGroupIds($user);
254
			if (!empty($usersGroups)) {
255
				$remainingGroups = array_diff($usersGroups, $excludedGroups);

lib/private/share20/manager.php 1 location

@@ 1158-1162 (lines=5) @@
1155
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1156
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1157
			$excludedGroups = json_decode($groupsList);
1158
			if (is_null($excludedGroups)) {
1159
				$excludedGroups = explode(',', $groupsList);
1160
				$newValue = json_encode($excludedGroups);
1161
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1162
			}
1163
			$user = $this->userManager->get($userId);
1164
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1165
			if (!empty($usersGroups)) {