From feb484dc9f591e2766f17f32715065923ce71aa7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 11 Nov 2016 22:43:15 -0500 Subject: [PATCH] added viewable checks on autofill for iOS --- src/iOS.Extension/Models/FillScript.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iOS.Extension/Models/FillScript.cs b/src/iOS.Extension/Models/FillScript.cs index 8b0f98df4..d17485eb7 100644 --- a/src/iOS.Extension/Models/FillScript.cs +++ b/src/iOS.Extension/Models/FillScript.cs @@ -19,7 +19,7 @@ namespace Bit.iOS.Extension.Models List usernames = new List(); List passwords = new List(); - var passwordFields = pageDetails.Fields.Where(f => f.Type == "password").ToArray(); + var passwordFields = pageDetails.Fields.Where(f => f.Type == "password" && f.Viewable).ToArray(); foreach(var form in pageDetails.Forms) { var passwordFieldsForForm = passwordFields.Where(f => f.Form == form.Key).ToArray(); @@ -32,7 +32,7 @@ namespace Bit.iOS.Extension.Models foreach(var pf in passwordFieldsForForm) { - var username = pageDetails.Fields.LastOrDefault(f => f.Form == pf.Form + var username = pageDetails.Fields.LastOrDefault(f => f.Form == pf.Form && f.Viewable && f.ElementNumber < pf.ElementNumber && (f.Type == "text" || f.Type == "email" || f.Type == "tel")); if(username != null) { @@ -51,7 +51,7 @@ namespace Bit.iOS.Extension.Models if(!string.IsNullOrWhiteSpace(fillUsername) && pf.ElementNumber > 0) { - var username = pageDetails.Fields.LastOrDefault(f => f.ElementNumber < pf.ElementNumber + var username = pageDetails.Fields.LastOrDefault(f => f.ElementNumber < pf.ElementNumber && f.Viewable && (f.Type == "text" || f.Type == "email" || f.Type == "tel")); if(username != null) {