Author: ashish
Date: Sun Jan 4 19:53:29 2015
New Revision: 1649393
URL: http://svn.apache.org/r1649393
Log:
Applied patch from jira issue - OFBIZ-3464 - Added check if the creditcard
number string is numeric in validation method isCreditcard in UtilValidate.
Thanks Nils for creating the issue and providing the patch for the same. Thanks
Divesh for your help in verification.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java?rev=1649393&r1=1649392&r2=1649393&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java
(original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java Sun
Jan 4 19:53:29 2015
@@ -1052,7 +1052,9 @@ public class UtilValidate {
public static boolean isCreditCard(String stPassed) {
if (isEmpty(stPassed)) return defaultEmptyOK;
String st = stripCharsInBag(stPassed, creditCardDelimiters);
-
+
+ if (!isInteger(st)) return false;
+
// encoding only works on cars with less the 19 digits
if (st.length() > 19) return false;
return sumIsMod10(getLuhnSum(st));