Bug 234770: Password field names are used instead of username field names to find acceptable signons, patch by Michael Wu <michael.wu@mozilla.com>, r=enndeakin

This commit is contained in:
gavin%gavinsharp.com 2006-07-25 21:36:43 +00:00
Родитель 13275df82a
Коммит 00cca42af3
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -1801,6 +1801,7 @@ nsPasswordManager::FillDocument(nsIDOMDocument* aDomDoc)
form->GetElementCount(&count);
PRUint32 i;
nsCOMPtr<nsIFormControl> formControl;
userField = nsnull;
for (i = 0; i < count; i++) {
form->GetElementAt(i, getter_AddRefs(formControl));
@ -1820,6 +1821,10 @@ nsPasswordManager::FillDocument(nsIDOMDocument* aDomDoc)
}
}
// Bail out if we should be seeing a userField but we're not
if (!userField && !(e->userField).IsEmpty())
continue;
if (!(e->passField).IsEmpty()) {
form->ResolveName(e->passField, getter_AddRefs(foundNode));
temp = do_QueryInterface(foundNode);