Move ExpiryMonth fieldnames to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 14:10:16 +01:00
parent 768f4b676c
commit 8992f348d2
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 43 additions and 8 deletions

View File

@ -403,14 +403,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.exp = f;
break;
} else if (!fillFields.expMonth && this.isFieldMatch(f[attr],
['exp-month', 'cc-exp-month', 'cc-month', 'card-month', 'cc-mo', 'card-mo', 'exp-mo',
'card-exp-mo', 'cc-exp-mo', 'card-expiration-month', 'expiration-month',
'cc-mm', 'cc-m', 'card-mm', 'card-m', 'card-exp-mm', 'cc-exp-mm', 'exp-mm', 'exp-m',
'expire-month', 'expire-mo', 'expiry-month', 'expiry-mo', 'card-expire-month',
'card-expire-mo', 'card-expiry-month', 'card-expiry-mo', 'mois-validite',
'mois-expiration', 'm-validite', 'm-expiration', 'expiry-date-field-month',
'expiration-date-month', 'expiration-date-mm', 'exp-mon', 'validity-mo',
'exp-date-mo', 'cb-date-mois', 'date-m'])) {
CreditCardAutoFillConstants.ExpiryMonthFieldNames)) {
fillFields.expMonth = f;
break;
} else if (!fillFields.expYear && this.isFieldMatch(f[attr],

View File

@ -50,6 +50,48 @@ export class CreditCardAutoFillConstants {
"label-right",
];
static readonly ExpiryMonthFieldNames: string[] = [
"exp-month",
"cc-exp-month",
"cc-month",
"card-month",
"cc-mo",
"card-mo",
"exp-mo",
"card-exp-mo",
"cc-exp-mo",
"card-expiration-month",
"expiration-month",
"cc-mm",
"cc-m",
"card-mm",
"card-m",
"card-exp-mm",
"cc-exp-mm",
"exp-mm",
"exp-m",
"expire-month",
"expire-mo",
"expiry-month",
"expiry-mo",
"card-expire-month",
"card-expire-mo",
"card-expiry-month",
"card-expiry-mo",
"mois-validite",
"mois-expiration",
"m-validite",
"m-expiration",
"expiry-date-field-month",
"expiration-date-month",
"expiration-date-mm",
"exp-mon",
"validity-mo",
"exp-date-mo",
"cb-date-mois",
"date-m",
];
// Each index represents a language. These three arrays should all be the same length.
// 0: English, 1: Danish, 2: German/Dutch, 3: French/Spanish/Italian, 4: Russian, 5: Portuguese
static readonly MonthAbbr = ["mm", "mm", "mm", "mm", "mm", "mm"];