svn commit: r1003596 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1003596 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

jleroux@apache.org
Author: jleroux
Date: Fri Oct  1 17:59:13 2010
New Revision: 1003596

URL: http://svn.apache.org/viewvc?rev=1003596&view=rev
Log:
Excerpt from a BJ's patch at "Message: In field [headerString] less-than (<) and greater-than (>) symbols are not allowed.In field [messageId] less-than (<) and greater-than (>) symbols are not allowed." (https://issues.apache.org/jira/browse/OFBIZ-2544) - OFBIZ-2544

I kept only the replacing lines (there were conflicts)

Modified:
    ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=1003596&r1=1003595&r2=1003596&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Fri Oct  1 17:59:13 2010
@@ -668,7 +668,7 @@ public class CommunicationEventServices
             Address[] addressesTo = wrapper.getTo();
             Address[] addressesCC = wrapper.getCc();
             Address[] addressesBCC = wrapper.getBcc();
-            String messageId = wrapper.getMessageId();
+            String messageId = wrapper.getMessageId().replaceAll("<|>", "");;
 
             String aboutThisEmail = "message [" + messageId + "] from [" +
                 (addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + "] to [" +
@@ -794,7 +794,7 @@ public class CommunicationEventServices
             if (inReplyTo != null && inReplyTo[0] != null) {
                 GenericValue parentCommEvent = null;
                 try {
-                    List<GenericValue> events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0]));
+                    List<GenericValue> events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0].replaceAll("<|>", "")));
                     parentCommEvent = EntityUtil.getFirst(events);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
@@ -854,7 +854,8 @@ public class CommunicationEventServices
                 headerString.append(System.getProperty("line.separator"));
                 headerString.append(headerLines.nextElement());
             }
-            commEventMap.put("headerString", headerString.toString());
+            String header = headerString.toString();
+            commEventMap.put("headerString", header.replaceAll("<|>", ""));
 
             result = dispatcher.runSync("createCommunicationEvent", commEventMap);
             communicationEventId = (String)result.get("communicationEventId");