You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2015/01/04 20:53:29 UTC

svn commit: r1649393 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilValidate.java

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));