mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
improve card autofill detection
This commit is contained in:
@@ -463,7 +463,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
} else if (!fillFields.code && this.isFieldMatch(f[attr],
|
} else if (!fillFields.code && this.isFieldMatch(f[attr],
|
||||||
['cvv', 'cvc', 'cvv2', 'cc-csc', 'cc-cvv', 'card-csc', 'card-cvv', 'cvd', 'cid', 'cvc2',
|
['cvv', 'cvc', 'cvv2', 'cc-csc', 'cc-cvv', 'card-csc', 'card-cvv', 'cvd', 'cid', 'cvc2',
|
||||||
'cnv', 'cvn2', 'cc-code', 'card-code', 'code-securite', 'security-code', 'crypto',
|
'cnv', 'cvn2', 'cc-code', 'card-code', 'code-securite', 'security-code', 'crypto',
|
||||||
'card-verif', 'verification-code'])) {
|
'card-verif', 'verification-code', 'csc', 'ccv'])) {
|
||||||
fillFields.code = f;
|
fillFields.code = f;
|
||||||
break;
|
break;
|
||||||
} else if (!fillFields.brand && this.isFieldMatch(f[attr],
|
} else if (!fillFields.brand && this.isFieldMatch(f[attr],
|
||||||
@@ -512,7 +512,11 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
if (fillFields.expYear.selectInfo && fillFields.expYear.selectInfo.options) {
|
if (fillFields.expYear.selectInfo && fillFields.expYear.selectInfo.options) {
|
||||||
for (let i = 0; i < fillFields.expYear.selectInfo.options.length; i++) {
|
for (let i = 0; i < fillFields.expYear.selectInfo.options.length; i++) {
|
||||||
const o: [string, string] = fillFields.expYear.selectInfo.options[i];
|
const o: [string, string] = fillFields.expYear.selectInfo.options[i];
|
||||||
if (o[0] === card.expYear) {
|
if (o[0] === card.expYear || o[1] === card.expYear) {
|
||||||
|
expYear = o[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (o[1].length === 2 && card.expYear.length === 4 && o[1] === card.expYear.substring(2)) {
|
||||||
expYear = o[1];
|
expYear = o[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user