bug on second reply fixed, newline bug fixed as well

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-mail-servlet@120074 82a268e6-3cf1-43bd-a215-b396298e98cf
Feature/21689
Massimiliano Assante 9 years ago
parent 9b28893195
commit 1939ab6cb0

@ -222,11 +222,9 @@ public class PeriodicTask implements Runnable {
private void handleMessageReply(String portalName, String messageId, Message message, ASLSession fakeSession) { private void handleMessageReply(String portalName, String messageId, Message message, ASLSession fakeSession) {
String subject = ""; String subject = "";
String messageText = ""; String messageText = "";
String escapedMessageText = "";
try { try {
subject = message.getSubject(); subject = message.getSubject();
messageText = extractText(portalName, messageId, message); messageText = extractText(portalName, messageId, message);
escapedMessageText = Utils.escapeHtmlAndTransformUrl(messageText);
} catch (Exception e1) { } catch (Exception e1) {
e1.printStackTrace(); e1.printStackTrace();
} }
@ -264,7 +262,7 @@ public class PeriodicTask implements Runnable {
_log.debug("Sending message notifications ... "); _log.debug("Sending message notifications ... ");
List<GenericItemBean> recipients = getUsersbyUserId(recipientIds); List<GenericItemBean> recipients = getUsersbyUserId(recipientIds);
NotificationsManager nm = new ApplicationNotificationsManager(fakeSession); NotificationsManager nm = new ApplicationNotificationsManager(fakeSession);
Thread thread = new Thread(new MessageNotificationsThread(recipients, messageId, subject, escapedMessageText, nm)); Thread thread = new Thread(new MessageNotificationsThread(recipients, newMessageId, subject, messageText, nm));
thread.start(); thread.start();
} else { } else {
_log.debug("Could not send message reply"); _log.debug("Could not send message reply");

@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
public class Utils { public class Utils {
private static final Logger _log = LoggerFactory.getLogger(Utils.class); private static final Logger _log = LoggerFactory.getLogger(Utils.class);
/** /**
* Escape an html string. Escaping data received from the client helps to * Escape an html string. Escaping data received from the client helps to
* prevent cross-site script vulnerabilities. * prevent cross-site script vulnerabilities.

Loading…
Cancel
Save