Code Duplication    Length = 5-5 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1230-1234 (lines=5) @@
1227
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1228
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1229
			$excludedGroups = json_decode($groupsList);
1230
			if (is_null($excludedGroups)) {
1231
				$excludedGroups = explode(',', $groupsList);
1232
				$newValue = json_encode($excludedGroups);
1233
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1234
			}
1235
			$user = $this->userManager->get($userId);
1236
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1237
			if (!empty($usersGroups)) {

lib/private/legacy/util.php 1 location

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