mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
support reversed 13 length month select
This commit is contained in:
@@ -494,14 +494,20 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
|
|
||||||
if (fillFields.expMonth.selectInfo && fillFields.expMonth.selectInfo.options) {
|
if (fillFields.expMonth.selectInfo && fillFields.expMonth.selectInfo.options) {
|
||||||
let index: number = null;
|
let index: number = null;
|
||||||
if (fillFields.expMonth.selectInfo.options.length === 12) {
|
const siOptions = fillFields.expMonth.selectInfo.options;
|
||||||
|
if (siOptions.length === 12) {
|
||||||
index = parseInt(card.expMonth, null) - 1;
|
index = parseInt(card.expMonth, null) - 1;
|
||||||
} else if (fillFields.expMonth.selectInfo.options.length === 13) {
|
} else if (siOptions.length === 13) {
|
||||||
index = parseInt(card.expMonth, null);
|
if (siOptions[0][0] != null && siOptions[0][0] !== '' &&
|
||||||
|
(siOptions[12][0] == null || siOptions[12][0] === '')) {
|
||||||
|
index = parseInt(card.expMonth, null) - 1;
|
||||||
|
} else {
|
||||||
|
index = parseInt(card.expMonth, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index != null) {
|
if (index != null) {
|
||||||
const option = fillFields.expMonth.selectInfo.options[index];
|
const option = siOptions[index];
|
||||||
if (option.length > 1) {
|
if (option.length > 1) {
|
||||||
expMonth = option[1];
|
expMonth = option[1];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user