Code Duplication    Length = 5-5 lines in 2 locations

apps/files_sharing/ajax/shareinfo.php 1 location

@@ 56-60 (lines=5) @@
53
$path = $data['realPath'];
54
55
$isWritable = $linkItem['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
56
if (!$isWritable) {
57
	\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
58
		return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));
59
	});
60
}
61
62
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
63
$rootView = new \OC\Files\View('');

apps/files_sharing/publicwebdav.php 1 location

@@ 61-65 (lines=5) @@
58
	$isWritable = $share['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
59
	$fileId = $share['file_source'];
60
61
	if (!$isWritable) {
62
		\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
63
			return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));
64
		});
65
	}
66
67
	OC_Util::setupFS($owner);
68
	$ownerView = \OC\Files\Filesystem::getView();