detect hidden field even when toggled

This commit is contained in:
Kyle Spearrin 2019-01-25 09:08:13 -05:00
parent d20b3cadbf
commit a1fdc4a970

View file

@ -341,16 +341,18 @@ namespace Bit.App.Utilities
{ {
if(cell is FormEntryCell entryCell) if(cell is FormEntryCell entryCell)
{ {
var type = entryCell.Entry.IsPassword || entryCell.Button2 != null ?
FieldType.Hidden : FieldType.Text;
fields.Add(new Field fields.Add(new Field
{ {
Name = string.IsNullOrWhiteSpace(entryCell.Label.Text) ? null : Name = string.IsNullOrWhiteSpace(entryCell.Label.Text) ? null :
entryCell.Label.Text.Encrypt(cipher.OrganizationId), entryCell.Label.Text.Encrypt(cipher.OrganizationId),
Value = string.IsNullOrWhiteSpace(entryCell.Entry.Text) ? null : Value = string.IsNullOrWhiteSpace(entryCell.Entry.Text) ? null :
entryCell.Entry.Text.Encrypt(cipher.OrganizationId), entryCell.Entry.Text.Encrypt(cipher.OrganizationId),
Type = entryCell.Entry.IsPassword ? FieldType.Hidden : FieldType.Text Type = type
}); });
if(entryCell.Entry.IsPassword && !string.IsNullOrWhiteSpace(entryCell.Label.Text)) if(type == FieldType.Hidden && !string.IsNullOrWhiteSpace(entryCell.Label.Text))
{ {
hiddenFieldValues.Add(new Tuple<string, string>(entryCell.Label.Text, hiddenFieldValues.Add(new Tuple<string, string>(entryCell.Label.Text,
entryCell.Entry.Text)); entryCell.Entry.Text));