From bd3fdcab2616cdb06e0fbf25a9e2a09a97eec463 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 29 Dec 2020 11:38:12 -0600 Subject: [PATCH] Do not export items that have been deleted (#1200) --- src/Core/Services/ExportService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/Services/ExportService.cs b/src/Core/Services/ExportService.cs index a5c973f36..1aa7b46e2 100644 --- a/src/Core/Services/ExportService.cs +++ b/src/Core/Services/ExportService.cs @@ -34,14 +34,15 @@ namespace Bit.Core.Services if (format == "encrypted_json") { var folders = (await _folderService.GetAllAsync()).Where(f => f.Id != null).Select(f => new FolderWithId(f)); - var items = (await _cipherService.GetAllAsync()).Where(c => c.OrganizationId == null).Select(c => new CipherWithId(c)); + var items = (await _cipherService.GetAllAsync()).Where(c => c.OrganizationId == null && c.DeletedDate == null) + .Select(c => new CipherWithId(c)); return ExportEncryptedJson(folders, items); } else { var decryptedFolders = await _folderService.GetAllDecryptedAsync(); - var decryptedCiphers = await _cipherService.GetAllDecryptedAsync(); + var decryptedCiphers = (await _cipherService.GetAllDecryptedAsync()).Where(c => c.DeletedDate == null); return format == "csv" ? ExportCsv(decryptedFolders, decryptedCiphers) : ExportJson(decryptedFolders, decryptedCiphers); }