diff --git a/src/CONST.js b/src/CONST.js index b7d8e91da5a2..b5e3d30516bd 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1118,7 +1118,6 @@ const CONST = { REGEX: { SPECIAL_CHARS_WITHOUT_NEWLINE: /((?!\n)[()-\s\t])/g, DIGITS_AND_PLUS: /^\+?[0-9]*$/, - ALPHABETIC_CHARS: /[a-zA-Z]+/, ALPHABETIC_CHARS_WITH_NUMBER: /^[a-zA-ZÀ-ÿ0-9 ]*$/, POSITIVE_INTEGER: /^\d+$/, PO_BOX: /\b[P|p]?(OST|ost)?\.?\s*[O|o|0]?(ffice|FFICE)?\.?\s*[B|b][O|o|0]?[X|x]?\.?\s+[#]?(\d+)\b/, diff --git a/src/languages/en.js b/src/languages/en.js index ceaa2d488d55..1130871559bf 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -595,7 +595,7 @@ export default { growlMessageOnSave: 'Your debit card was successfully added', expensifyPassword: 'Expensify password', error: { - invalidName: 'Please enter a valid name', + invalidName: 'Name can only include latin letters and numbers.', addressZipCode: 'Please enter a valid zip code', debitCardNumber: 'Please enter a valid debit card number', expirationDate: 'Please select a valid expiration date', diff --git a/src/languages/es.js b/src/languages/es.js index 0c605be9c174..349630ea6511 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -596,7 +596,7 @@ export default { growlMessageOnSave: 'Su tarteja de débito se agregó correctamente', expensifyPassword: 'Contraseña de Expensify', error: { - invalidName: 'Por favor, introduce un nombre válido', + invalidName: 'El nombre solo puede contener números y caracteres latinos.', addressZipCode: 'Por favor, introduce un código postal válido', debitCardNumber: 'Por favor, introduce un número de tarjeta de débito válido', expirationDate: 'Por favor, selecciona una fecha de vencimiento válida', diff --git a/src/libs/ValidationUtils.js b/src/libs/ValidationUtils.js index 0fdc65bc7a82..6f05da08c703 100644 --- a/src/libs/ValidationUtils.js +++ b/src/libs/ValidationUtils.js @@ -140,19 +140,6 @@ function isValidDebitCard(string) { return validateCardNumber(string); } -/** - * - * @param {String} nameOnCard - * @returns {Boolean} - */ -function isValidCardName(nameOnCard) { - if (!CONST.REGEX.ALPHABETIC_CHARS.test(nameOnCard)) { - return false; - } - - return !_.isEmpty(nameOnCard.trim()); -} - /** * @param {String} code * @returns {Boolean} @@ -464,7 +451,6 @@ export { getAgeRequirementError, isValidAddress, isValidDate, - isValidCardName, isValidPastDate, isValidSecurityCode, isValidExpirationDate, diff --git a/src/pages/settings/Payments/AddDebitCardPage.js b/src/pages/settings/Payments/AddDebitCardPage.js index 65be895baee3..87b3a774ef85 100644 --- a/src/pages/settings/Payments/AddDebitCardPage.js +++ b/src/pages/settings/Payments/AddDebitCardPage.js @@ -73,7 +73,7 @@ class DebitCardPage extends Component { validate(values) { const errors = {}; - if (!values.nameOnCard || !ValidationUtils.isValidCardName(values.nameOnCard)) { + if (!values.nameOnCard || !ValidationUtils.isValidLegalName(values.nameOnCard)) { errors.nameOnCard = 'addDebitCardPage.error.invalidName'; }