Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 391-396 (lines=6) @@
388
				throw new \Exception($message_t);
389
			}
390
			// verify that the user has share permission
391
			if (!\OC\Files\Filesystem::isSharable($path) || \OCP\Util::isSharingDisabledForUser()) {
392
				$message = 'You are not allowed to share %s';
393
				$message_t = $l->t('You are not allowed to share %s', [$path]);
394
				\OCP\Util::writeLog('OCP\Share', sprintf($message, $path), \OCP\Util::DEBUG);
395
				throw new \Exception($message_t);
396
			}
397
		}
398
399
		//verify that we don't share a folder which already contains a share mount point
@@ 877-882 (lines=6) @@
874
			$class = self::$backendTypes[$itemType]['class'];
875
			if (class_exists($class)) {
876
				self::$backends[$itemType] = new $class;
877
				if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) {
878
					$message = 'Sharing backend %s must implement the interface OCP\Share_Backend';
879
					$message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class));
880
					\OCP\Util::writeLog('OCP\Share', sprintf($message, $class), \OCP\Util::ERROR);
881
					throw new \Exception($message_t);
882
				}
883
				return self::$backends[$itemType];
884
			} else {
885
				$message = 'Sharing backend %s not found';