mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-21 13:16:03 +00:00
If multiple username inputs in login form, favor the one with the word 'login' in it.
This commit is contained in:
committed by
Noah Levitt
parent
eeeea6f0c4
commit
afa4f6535b
@@ -112,9 +112,22 @@ public class HTMLForm {
|
||||
* @return boolean likely login form
|
||||
*/
|
||||
public boolean seemsLoginForm() {
|
||||
return "post".equalsIgnoreCase(method)
|
||||
&& candidateUsernameInputs.size() == 1
|
||||
&& candidatePasswordInputs.size() == 1;
|
||||
if ("post".equalsIgnoreCase(method)) {
|
||||
if (candidatePasswordInputs.size() == 1) {
|
||||
if (candidateUsernameInputs.size() == 1) {
|
||||
return true;
|
||||
}
|
||||
else if (candidateUsernameInputs.size() > 1) {
|
||||
for (FormInput formInput : candidateUsernameInputs) {
|
||||
if (formInput.name != null && formInput.name.toLowerCase().indexOf("login") > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user