fix #471 : use base64 encode
This commit is contained in:
parent
dfc63e3591
commit
d544193bc9
6 changed files with 26 additions and 4 deletions
|
@ -16,6 +16,7 @@
|
|||
package org.codelibs.fess.app.web.admin.scheduler;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Base64;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
@ -121,7 +122,8 @@ public class AdminSchedulerAction extends FessAdminAction {
|
|||
scheduledJobForm.crawler = Constants.ON;
|
||||
scheduledJobForm.available = Constants.ON;
|
||||
scheduledJobForm.cronExpression = null;
|
||||
scheduledJobForm.name = MessageFormat.format(fessConfig.getJobTemplateTitle(type), name);
|
||||
final String decodedName = new String(Base64.getUrlDecoder().decode(name), Constants.CHARSET_UTF_8);
|
||||
scheduledJobForm.name = MessageFormat.format(fessConfig.getJobTemplateTitle(type), decodedName);
|
||||
final String[] ids = new String[] { "", "", "" };
|
||||
if (Constants.WEB_CRAWLER_TYPE.equals(type)) {
|
||||
ids[0] = "\"" + id + "\"";
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.text.ParseException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.core.misc.Base64Util;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.entity.FacetQueryView;
|
||||
import org.codelibs.fess.helper.ViewHelper;
|
||||
|
@ -216,4 +218,10 @@ public class FessFunctions {
|
|||
return query;
|
||||
}
|
||||
|
||||
public static String base64(final String value) {
|
||||
if (value == null) {
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
return Base64.getEncoder().encodeToString(value.getBytes(Constants.CHARSET_UTF_8));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,4 +179,16 @@
|
|||
</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns base64 encoded value.
|
||||
</description>
|
||||
<name>base64</name>
|
||||
<function-class>org.codelibs.fess.taglib.FessFunctions</function-class>
|
||||
<function-signature>java.lang.String base64(java.lang.String)</function-signature>
|
||||
<example>
|
||||
${fe:base64(value)}
|
||||
</example>
|
||||
</function>
|
||||
|
||||
</taglib>
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
<la:link styleClass="btn btn-success"
|
||||
href="/admin/scheduler/createnewjob/data_crawling/${f:u(id)}/${f:u(name)}">
|
||||
href="/admin/scheduler/createnewjob/data_crawling/${f:u(id)}/${fe:base64(name)}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<la:message key="labels.data_crawling_button_create_job" />
|
||||
</la:link>
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
<la:link styleClass="btn btn-success"
|
||||
href="/admin/scheduler/createnewjob/file_crawling/${f:u(id)}/${f:u(name)}">
|
||||
href="/admin/scheduler/createnewjob/file_crawling/${f:u(id)}/${fe:base64(name)}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<la:message key="labels.file_crawling_button_create_job" />
|
||||
</la:link>
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
<div class="box-footer">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/crud/buttons.jsp"></jsp:include>
|
||||
<la:link styleClass="btn btn-success"
|
||||
href="/admin/scheduler/createnewjob/web_crawling/${f:u(id)}/${f:u(name)}">
|
||||
href="/admin/scheduler/createnewjob/web_crawling/${f:u(id)}/${fe:base64(name)}">
|
||||
<i class="fa fa-plus-circle"></i>
|
||||
<la:message key="labels.web_crawling_button_create_job" />
|
||||
</la:link>
|
||||
|
|
Loading…
Add table
Reference in a new issue