Update to escape html search input
This commit is contained in:
parent
32186e4351
commit
ff05d69b69
1 changed files with 4 additions and 1 deletions
|
@ -18,6 +18,7 @@ import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
@ -148,7 +149,9 @@ public class PagedSearchController extends FreemarkerHttpServlet {
|
||||||
int startIndex = getStartIndex(vreq);
|
int startIndex = getStartIndex(vreq);
|
||||||
int hitsPerPage = getHitsPerPage( vreq );
|
int hitsPerPage = getHitsPerPage( vreq );
|
||||||
|
|
||||||
String qtxt = vreq.getParameter(VitroQuery.QUERY_PARAMETER_NAME);
|
String qtxt = vreq.getParameter(VitroQuery.QUERY_PARAMETER_NAME);
|
||||||
|
//Clean text to prevent cross-scripting errors
|
||||||
|
qtxt = StringEscapeUtils.escapeHtml(qtxt);
|
||||||
log.debug("Query text is \""+ qtxt + "\"");
|
log.debug("Query text is \""+ qtxt + "\"");
|
||||||
|
|
||||||
String badQueryMsg = badQueryText( qtxt );
|
String badQueryMsg = badQueryText( qtxt );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue