Code Duplication    Length = 8-8 lines in 2 locations

apps/files_sharing/api/share20ocs.php 2 locations

@@ 374-381 (lines=8) @@
371
			//Expire date
372
			$expireDate = $this->request->getParam('expireDate', '');
373
374
			if ($expireDate !== '') {
375
				try {
376
					$expireDate = $this->parseDate($expireDate);
377
					$share->setExpirationDate($expireDate);
378
				} catch (\Exception $e) {
379
					return new \OC_OCS_Result(null, 404, 'Invalid Date. Format must be YYYY-MM-DD.');
380
				}
381
			}
382
383
		} else if ($shareType === \OCP\Share::SHARE_TYPE_REMOTE) {
384
			if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) {
@@ 618-625 (lines=8) @@
615
616
			if ($expireDate === '') {
617
				$share->setExpirationDate(null);
618
			} else if ($expireDate !== null) {
619
				try {
620
					$expireDate = $this->parseDate($expireDate);
621
				} catch (\Exception $e) {
622
					return new \OC_OCS_Result(null, 400, $e->getMessage());
623
				}
624
				$share->setExpirationDate($expireDate);
625
			}
626
627
			if ($password === '') {
628
				$share->setPassword(null);