1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-19 11:15:21 +01:00

Move card expiry fieldnames to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 15:44:57 +01:00
parent ec60979ee2
commit 4e274c2f44
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 22 additions and 4 deletions

View File

@ -393,10 +393,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.number = f; fillFields.number = f;
break; break;
} else if (!fillFields.exp && this.isFieldMatch(f[attr], } else if (!fillFields.exp && this.isFieldMatch(f[attr],
['cc-exp', 'card-exp', 'cc-expiration', 'card-expiration', 'cc-ex', 'card-ex', CreditCardAutoFillConstants.CardExpiryFieldNames,
'card-expire', 'card-expiry', 'validite', 'expiration', 'expiry', 'mm-yy',
'mm-yyyy', 'yy-mm', 'yyyy-mm', 'expiration-date', 'payment-card-expiration',
'payment-cc-date'],
['mm-yy', 'mm-yyyy', 'yy-mm', 'yyyy-mm', 'expiration-date', ['mm-yy', 'mm-yyyy', 'yy-mm', 'yyyy-mm', 'expiration-date',
'payment-card-expiration'])) { 'payment-card-expiration'])) {
fillFields.exp = f; fillFields.exp = f;

View File

@ -76,6 +76,27 @@ export class CreditCardAutoFillConstants {
"cb-num", "cb-num",
]; ];
static readonly CardExpiryFieldNames: string[] = [
"cc-exp",
"card-exp",
"cc-expiration",
"card-expiration",
"cc-ex",
"card-ex",
"card-expire",
"card-expiry",
"validite",
"expiration",
"expiry",
"mm-yy",
"mm-yyyy",
"yy-mm",
"yyyy-mm",
"expiration-date",
"payment-card-expiration",
"payment-cc-date",
];
static readonly ExpiryMonthFieldNames: string[] = [ static readonly ExpiryMonthFieldNames: string[] = [
"exp-month", "exp-month",
"cc-exp-month", "cc-exp-month",