Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 327-331 (lines=5) @@
324
		if ($config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
325
			$groupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', '');
326
			$excludedGroups = json_decode($groupsList);
327
			if (is_null($excludedGroups)) {
328
				$excludedGroups = explode(',', $groupsList);
329
				$newValue = json_encode($excludedGroups);
330
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
331
			}
332
			$usersGroups = $groupManager->getUserGroupIds($user);
333
			if (!empty($usersGroups)) {
334
				$remainingGroups = array_diff($usersGroups, $excludedGroups);

lib/private/Share20/Manager.php 1 location

@@ 1299-1303 (lines=5) @@
1296
		if ($this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes') {
1297
			$groupsList = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1298
			$excludedGroups = json_decode($groupsList);
1299
			if (is_null($excludedGroups)) {
1300
				$excludedGroups = explode(',', $groupsList);
1301
				$newValue = json_encode($excludedGroups);
1302
				$this->config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
1303
			}
1304
			$user = $this->userManager->get($userId);
1305
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1306
			if (!empty($usersGroups)) {