escape defaultQuery so it's safe to display in HTML forms

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@481121 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2006-12-01 00:52:35 +00:00
parent eb897e53d0
commit 840875e7d9
1 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,9 @@
org.apache.solr.schema.IndexSchema,
java.io.File"%>
<%@ page import="java.net.InetAddress"%>
<%@ page import="java.io.StringWriter"%>
<%@ page import="org.apache.solr.core.Config"%>
<%@ page import="org.apache.solr.util.XML"%>
<%
SolrCore core = SolrCore.getSolrCore();
@ -40,7 +42,10 @@
InetAddress addr = InetAddress.getLocalHost();
String hostname = addr.getCanonicalHostName();
String defaultSearch = SolrConfig.config.get("admin/defaultQuery/text()",null);
StringWriter tmp = new StringWriter();
XML.escapeCharData(SolrConfig.config.get("admin/defaultQuery/text()", null),
tmp);
String defaultSearch = tmp.toString();
String cwd=System.getProperty("user.dir");
String solrHome= Config.getInstanceDir();
%>