Code Duplication    Length = 9-10 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

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