Code Duplication    Length = 4-4 lines in 2 locations

apps/files_sharing/lib/Controllers/ShareController.php 2 locations

@@ 281-284 (lines=4) @@
278
		}
279
280
		// Share is password protected - check whether the user is permitted to access the share
281
		if ($share->getPassword() !== null && !$this->linkShareAuth($share)) {
282
			return new RedirectResponse($this->urlGenerator->linkToRoute('files_sharing.sharecontroller.authenticate',
283
				['token' => $token]));
284
		}
285
286
		if (!$this->validateShare($share)) {
287
			throw new NotFoundException();
@@ 404-407 (lines=4) @@
401
		$share = $this->shareManager->getShareByToken($token);
402
403
		// Share is password protected - check whether the user is permitted to access the share
404
		if ($share->getPassword() !== null && !$this->linkShareAuth($share)) {
405
			return new RedirectResponse($this->urlGenerator->linkToRoute('files_sharing.sharecontroller.authenticate',
406
				['token' => $token]));
407
		}
408
409
		if (($share->getPermissions() & \OCP\Constants::PERMISSION_READ) === 0) {
410
			throw new NotFoundException();