svnno****@sourc*****
svnno****@sourc*****
2009年 1月 29日 (木) 12:07:48 JST
Revision: 1703 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1703 Author: shinsuke Date: 2009-01-29 12:07:48 +0900 (Thu, 29 Jan 2009) Log Message: ----------- fixed garbage chars of a name. Modified Paths: -------------- chat/trunk/src/main/java/jp/sf/pal/chat/action/ChatAction.java chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp -------------- next part -------------- Modified: chat/trunk/src/main/java/jp/sf/pal/chat/action/ChatAction.java =================================================================== --- chat/trunk/src/main/java/jp/sf/pal/chat/action/ChatAction.java 2009-01-28 08:57:44 UTC (rev 1702) +++ chat/trunk/src/main/java/jp/sf/pal/chat/action/ChatAction.java 2009-01-29 03:07:48 UTC (rev 1703) @@ -70,10 +70,13 @@ @Execute(validator = false) public String chat() { if (!StringUtils.isEmpty(chatForm.msg)) { + String nameArg0 = StringEscapeUtils.escapeHtml(chatForm.nameArg0); + String nameArg1 = StringEscapeUtils.escapeHtml(chatForm.nameArg1); + String nameArg2 = StringEscapeUtils.escapeHtml(chatForm.nameArg2); String msg = StringEscapeUtils.escapeHtml(chatForm.msg); - ChatUtil.add(ChatConstants.DEFAULT_SCOPE, chatForm.nameArg0, - chatForm.nameArg1, chatForm.nameArg2, msg, new Date(), - ChatConstants.DEFAULT_SHOW_NUM, context); + ChatUtil.add(ChatConstants.DEFAULT_SCOPE, nameArg0, nameArg1, + nameArg2, msg, new Date(), ChatConstants.DEFAULT_SHOW_NUM, + context); } loadChat(); return null; Modified: chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp =================================================================== --- chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp 2009-01-28 08:57:44 UTC (rev 1702) +++ chat/trunk/src/main/webapp/WEB-INF/view/chat/index.jsp 2009-01-29 03:07:48 UTC (rev 1703) @@ -47,8 +47,11 @@ <th><bean:message key="labels.message"/></th> <td> <input type="text" name="msg" value="" id="message<portlet:namespace/>"> + <input type="hidden" value="${f:h(nameArg0)}" id="nameArg0<portlet:namespace/>"> + <input type="hidden" value="${f:h(nameArg1)}" id="nameArg1<portlet:namespace/>"> + <input type="hidden" value="${f:h(nameArg2)}" id="nameArg2<portlet:namespace/>"> <input type="button" value="<bean:message key="labels.send"/>" - onclick="$('#contents<portlet:namespace/>').load('${f:url('chat')}',{'nameArg0':'${f:u(nameArg0)}','nameArg1':'${f:u(nameArg1)}','nameArg2':'${f:u(nameArg2)}','msg':$('#message<portlet:namespace/>')[0].value}); + onclick="$('#contents<portlet:namespace/>').load('${f:url('chat')}',{'nameArg0':$('#nameArg0<portlet:namespace/>')[0].value,'nameArg1':$('#nameArg1<portlet:namespace/>')[0].value,'nameArg2':$('#nameArg2<portlet:namespace/>')[0].value,'msg':$('#message<portlet:namespace/>')[0].value}); $('#message<portlet:namespace/>')[0].value= ''; <portlet:namespace/>loadChat()" /> <input type="button" value="<bean:message key="labels.load_now"/>" onclick="<portlet:namespace/>loadChat()" /> </td>