escape entities on Captcha.jsp request parameters
if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
String pagereq = wikiContext.getName();
- String content = request.getParameter("text");
+ String reqPage = TextUtil.replaceEntities( request.getParameter( "page" ) );
+ String content = TextUtil.replaceEntities( request.getParameter( "text" ) );
if( content != null )
{
- String ticket = request.getParameter("Asirra_Ticket");
+ String ticket = TextUtil.replaceEntities( request.getParameter( "Asirra_Ticket" ) );
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod("http://challenge.asirra.com/cgi/Asirra?action=ValidateTicket&ticket="+ticket);
if( body.indexOf( "Pass" ) != -1 )
{
session.setAttribute( "captcha", "ok" );
- response.sendRedirect( wikiContext.getURL(WikiContext.EDIT, request.getParameter("page") ) );
+ response.sendRedirect( wikiContext.getURL( WikiContext.EDIT, reqPage ) );
return;
}
}
<form action="<wiki:Link jsp='Captcha.jsp' format='url'/>" method="post" id="mainForm" style="display: none;">
<input type="hidden" value="foo" name="text" />
- <input type="hidden" value='<%=request.getParameter("page")%>' name='page'/>
+ <input type="hidden" value='<%=reqPage%>' name='page'/>
<script type="text/javascript" src="http://challenge.asirra.com/js/AsirraClientSide.js"></script>
<script type="text/javascript">
asirraState.SetEnlargedPosition( "right" );
</form>
</div>
</body>
+</html>
\ No newline at end of file
