Author: apatel
Date: Thu Jun 28 13:12:40 2007
New Revision: 551689
URL:
http://svn.apache.org/viewvc?view=rev&rev=551689Log:
little more secured parsing.
Modified:
ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?view=diff&rev=551689&r1=551688&r2=551689==============================================================================
--- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original)
+++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Thu Jun 28 13:12:40 2007
@@ -375,7 +375,7 @@
List trackingCodeOrders = new LinkedList();
Cookie[] cookies = request.getCookies();
- String affiliateReferredTimeStamp = null;
+ Timestamp affiliateReferredTimeStamp = null;
String siteId = null;
String isBillable = null;
String trackingCodeId = null;
@@ -392,7 +392,14 @@
// find the referred timestamp cookie if it exists
if ("Ofbiz.TKCD.UpdatedTimeStamp".equals(cookieName)) {
- affiliateReferredTimeStamp = cookies[i].getValue();
+ String affiliateReferredTime = cookies[i].getValue();
+ if (affiliateReferredTime !=null && !affiliateReferredTime.equals("")){
+ try{
+ affiliateReferredTimeStamp = Timestamp.valueOf(affiliateReferredTime);
+ }catch (IllegalArgumentException e){
+ Debug.logError(e, "Error parsing affiliateReferredTimeStamp value from cookie", module);
+ }
+ }
}
// find any that start with TKCDB_ for billable tracking code cookies with isBillable=Y
@@ -426,7 +433,7 @@
GenericValue trackingCodeOrder = delegator.makeValue("TrackingCodeOrder",
UtilMisc.toMap("trackingCodeTypeId", trackingCode.get("trackingCodeTypeId"),
"trackingCodeId", trackingCodeId, "isBillable", isBillable, "siteId", siteId,
- "hasExported", "N", "affiliateReferredTimeStamp",Timestamp.valueOf(affiliateReferredTimeStamp) ));
+ "hasExported", "N", "affiliateReferredTimeStamp",affiliateReferredTimeStamp ));
Debug.logInfo(" trackingCodeOrder is " + trackingCodeOrder, module);
trackingCodeOrders.add(trackingCodeOrder);