Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1645)

Unified Diff: components/autofill/core/browser/validation.cc

Issue 2170773002: UnionPay credit card numbers now validated by Luhn checksum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/validation.cc
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
index a063ab2fa004e3227bc6e46e16f91a82282148a8..b0f0a2a72bce6e1a662daa0a1a389bada153de34 100644
--- a/components/autofill/core/browser/validation.cc
+++ b/components/autofill/core/browser/validation.cc
@@ -61,11 +61,6 @@ bool IsValidCreditCardNumber(const base::string16& text) {
if (type == kGenericCard && (number.size() < 12 || number.size() > 19))
return false;
- // Unlike all the other supported types, UnionPay cards lack Luhn checksum
- // validation.
- if (type == kUnionPay)
- return true;
-
// Use the Luhn formula [3] to validate the number.
// [3] http://en.wikipedia.org/wiki/Luhn_algorithm
int sum = 0;
« no previous file with comments | « components/autofill/core/browser/credit_card_unittest.cc ('k') | components/autofill/core/browser/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698