#615 encode queries
This commit is contained in:
parent
ec370d549d
commit
ebb973c38d
1 changed files with 9 additions and 5 deletions
|
@ -324,11 +324,15 @@ public class ViewHelper {
|
|||
protected String appendPDFSearchWord(final String url) {
|
||||
final String queries = (String) LaRequestUtil.getRequest().getAttribute(Constants.REQUEST_QUERIES);
|
||||
if (queries != null) {
|
||||
final StringBuilder buf = new StringBuilder(url.length() + 100);
|
||||
buf.append(url).append("#search=%22");
|
||||
buf.append(queries); // TODO encode
|
||||
buf.append("%22");
|
||||
return buf.toString();
|
||||
try {
|
||||
final StringBuilder buf = new StringBuilder(url.length() + 100);
|
||||
buf.append(url).append("#search=%22");
|
||||
buf.append(URLEncoder.encode(queries, Constants.UTF_8));
|
||||
buf.append("%22");
|
||||
return buf.toString();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
logger.warn("Unsupported encoding.",e);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue