Skip to content

Commit 25a5f3a

Browse files
committed
Merge remote-tracking branch 'origin/V4.0' into V5
2 parents 4883803 + 7e5456d commit 25a5f3a

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/base/AbstractCkEditorController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public class AbstractCkEditorController {
4545
private static final String RESULT_FILENAME = "fileName";
4646
private static final String RESULT_URL = "url";
4747

48-
protected Map<String, Object> upload(SysSite site, SysUser user, MultipartFile upload, String ckCsrfToken, String channel,
49-
String csrfToken, HttpServletRequest request) {
48+
protected Map<String, Object> upload(SysSite site, SysUser user, MultipartFile upload, String ckCsrfToken,
49+
String csrfToken, String channel, HttpServletRequest request) {
5050
Map<String, Object> map = new HashMap<>();
5151
int uploaded = 0;
5252
if (null != upload && !upload.isEmpty() && csrfToken.equals(ckCsrfToken)) {

publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/site/SiteComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public String getWebBackupFilePath(short siteId, String filepath) {
371371
* @return site file path
372372
*/
373373
public String getSiteFilePath(String path) {
374-
return CommonUtils.joinString(rootPath, BACKUP_PATH, Constants.SEPARATOR, SITE_FILE_PATH, Constants.SEPARATOR, path);
374+
return CommonUtils.joinString(rootPath, BACKUP_PATH, Constants.SEPARATOR, SITE_FILE_PATH, Constants.SEPARATOR, CmsFileUtils.getSafeFileName(path));
375375
}
376376

377377
/**

publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/dao/cms/CmsContentSearchDao.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,22 @@ public FacetPageHandler facetQuery(CmsContentSearchQuery queryEntity, String ord
140140
}
141141

142142
private void initHighLighterQuery(HighLighterQuery highLighterQuery, String text) {
143-
if (highLighterQuery.isHighlight() && CommonUtils.notEmpty(text)) {
143+
if (highLighterQuery.isHighlight()) {
144144
highLighterQuery.setFields(highLighterTextFields);
145-
Backend backend = dao.getSearchBackend();
146-
Optional<? extends Analyzer> analyzer;
147-
if (backend instanceof LuceneBackend) {
148-
analyzer = backend.unwrap(LuceneBackend.class).analyzer(CmsContentAttributeBinder.ANALYZER_NAME);
149-
} else {
150-
analyzer = Optional.of(new StandardAnalyzer());
151-
}
152-
if (analyzer.isPresent()) {
153-
MultiFieldQueryParser queryParser = new MultiFieldQueryParser(highLighterTextFields, analyzer.get());
154-
try {
155-
highLighterQuery.setQuery(queryParser.parse(text));
156-
} catch (ParseException e) {
145+
if (CommonUtils.notEmpty(text)) {
146+
Backend backend = dao.getSearchBackend();
147+
Optional<? extends Analyzer> analyzer;
148+
if (backend instanceof LuceneBackend) {
149+
analyzer = backend.unwrap(LuceneBackend.class).analyzer(CmsContentAttributeBinder.ANALYZER_NAME);
150+
} else {
151+
analyzer = Optional.of(new StandardAnalyzer());
152+
}
153+
if (analyzer.isPresent()) {
154+
MultiFieldQueryParser queryParser = new MultiFieldQueryParser(highLighterTextFields, analyzer.get());
155+
try {
156+
highLighterQuery.setQuery(queryParser.parse(text));
157+
} catch (ParseException e) {
158+
}
157159
}
158160
}
159161
}

0 commit comments

Comments
 (0)