Code Duplication    Length = 9-10 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 719-727 (lines=9) @@
716
			$this->linkCreateChecks($share);
717
718
			// Password updated.
719
			if ($share->getPassword() !== $originalShare->getPassword()) {
720
				//Verify the password
721
				$this->verifyPassword($share->getPassword());
722
723
				// If a password is set. Hash it!
724
				if ($share->getPassword() !== null) {
725
					$share->setPassword($this->hasher->hash($share->getPassword()));
726
				}
727
			}
728
729
			if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
730
				//Verify the expiration date
@@ 739-748 (lines=10) @@
736
		$plainTextPassword = null;
737
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK || $share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
738
			// Password updated.
739
			if ($share->getPassword() !== $originalShare->getPassword()) {
740
				//Verify the password
741
				$this->verifyPassword($share->getPassword());
742
743
				// If a password is set. Hash it!
744
				if ($share->getPassword() !== null) {
745
					$plainTextPassword = $share->getPassword();
746
					$share->setPassword($this->hasher->hash($plainTextPassword));
747
				}
748
			}
749
		}
750
751
		$this->pathCreateChecks($share->getNode());