Code Duplication    Length = 5-5 lines in 2 locations

lib/private/legacy/util.php 1 location

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

lib/private/Share20/Manager.php 1 location

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