Code Duplication    Length = 9-9 lines in 2 locations

apps/files_sharing/lib/API/Share20OCS.php 2 locations

@@ 376-384 (lines=9) @@
373
			//Expire date
374
			$expireDate = $this->request->getParam('expireDate', '');
375
376
			if ($expireDate !== '') {
377
				try {
378
					$expireDate = $this->parseDate($expireDate);
379
					$share->setExpirationDate($expireDate);
380
				} catch (\Exception $e) {
381
					$share->getNode()->unlock(ILockingProvider::LOCK_SHARED);
382
					return new \OC_OCS_Result(null, 404, $this->l->t('Invalid date, date format must be YYYY-MM-DD'));
383
				}
384
			}
385
386
		} else if ($shareType === \OCP\Share::SHARE_TYPE_REMOTE) {
387
			if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) {
@@ 644-652 (lines=9) @@
641
642
			if ($expireDate === '') {
643
				$share->setExpirationDate(null);
644
			} else if ($expireDate !== null) {
645
				try {
646
					$expireDate = $this->parseDate($expireDate);
647
				} catch (\Exception $e) {
648
					$share->getNode()->unlock(ILockingProvider::LOCK_SHARED);
649
					return new \OC_OCS_Result(null, 400, $e->getMessage());
650
				}
651
				$share->setExpirationDate($expireDate);
652
			}
653
654
			if ($password === '') {
655
				$share->setPassword(null);