Code Duplication    Length = 4-4 lines in 2 locations

lib/private/files/view.php 2 locations

@@ 1218-1221 (lines=4) @@
1215
1216
			if ($data and isset($data['fileid'])) {
1217
				// upgrades from oc6 or lower might not have the permissions set in the file cache
1218
				if ($data['permissions'] === 0) {
1219
					$data['permissions'] = $storage->getPermissions($data['path']);
1220
					$cache->update($data['fileid'], array('permissions' => $data['permissions']));
1221
				}
1222
				if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
1223
					//add the sizes of other mount points to the folder
1224
					$extOnly = ($includeMountPoints === 'ext');
@@ 1307-1310 (lines=4) @@
1304
			$contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter
1305
1306
			foreach ($contents as $content) {
1307
				if ($content['permissions'] === 0) {
1308
					$content['permissions'] = $storage->getPermissions($content['path']);
1309
					$cache->update($content['fileid'], array('permissions' => $content['permissions']));
1310
				}
1311
				// if sharing was disabled for the user we remove the share permissions
1312
				if (\OCP\Util::isSharingDisabledForUser()) {
1313
					$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;