Skip to content

Commit 0af5be0

Browse files
committed
Merge branch 'V5-develop' into V6-develop
2 parents 226651b + 5e8e09c commit 0af5be0

File tree

29 files changed

+141
-86
lines changed

29 files changed

+141
-86
lines changed

publiccms-parent/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,36 @@ subprojects {
3232
servletVersion = "6.1.0"
3333
// http://mvnrepository.com/artifact/org.springframework/spring-core
3434
// https://spring.io/projects/spring-framework
35-
springVersion = "7.0.1"
35+
springVersion = "7.0.2"
3636
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
3737
// https://spring.io/projects/spring-boot
3838
springBootVersion = "4.0.0"
3939
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
4040
junitVersion = "6.0.1"
4141
// http://mvnrepository.com/artifact/org.hibernate.orm/hibernate-core
4242
// http://hibernate.org/orm/downloads/
43-
hibernateVersion = "7.1.9.Final"
43+
hibernateVersion = "7.2.0.Final"
4444
// http://mvnrepository.com/artifact/org.hibernate.tool/hibernate-tools-orm
45-
hibernateToolsVersion = "7.1.9.Final"
45+
hibernateToolsVersion = "7.1.11.Final"
4646
// https://mvnrepository.com/artifact/org.hibernate.search/hibernate-search-mapper-orm
4747
// http://hibernate.org/search/downloads/
48-
hibernateSearchVersion = "8.1.2.Final"
48+
hibernateSearchVersion = "8.2.0.Final"
4949
// https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator
5050
hibernateValidatorVersion = "9.1.0.Final"
5151
// https://mvnrepository.com/artifact/org.ehcache/ehcache
5252
ehcacheVersion = "3.11.1"
5353
// http://mvnrepository.com/artifact/org.mybatis/mybatis
5454
mybatisVersion = "3.5.19"
5555
// http://mvnrepository.com/artifact/org.mybatis/mybatis-spring
56-
mybatisSpringVersion = "3.0.5"
56+
mybatisSpringVersion = "4.0.0"
5757
// http://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core
5858
mybatisGenerator = "1.4.2"
5959
// https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper
6060
pageHelperVersion = "6.1.1"
6161
// https://mvnrepository.com/artifact/org.mybatis.dynamic-sql/mybatis-dynamic-sql
6262
dynamicSqlVersion = "1.5.2"
6363
// http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
64-
jacksonVersion = "3.0.2"
64+
jacksonVersion = "3.0.3"
6565
// http://mvnrepository.com/artifact/org.freemarker/freemarker
6666
freemarkerVersion = "2.3.34"
6767
// https://mvnrepository.com/artifact/org.apache.lucene/lucene-core
@@ -71,7 +71,7 @@ subprojects {
7171
jedisVersion = "7.1.0"
7272
// http://mvnrepository.com/artifact/org.quartz-scheduler/quartz
7373
// https://github.com/quartz-scheduler/quartz/releases
74-
quartzVersion = "2.5.1"
74+
quartzVersion = "2.5.2"
7575
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
7676
// https://github.com/brettwooldridge/HikariCP
7777
hikariCPVersion = "7.0.2"
@@ -83,7 +83,7 @@ subprojects {
8383
// https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.poi.xwpf.converter.xhtml
8484
xhtmlConverterVersion = "2.1.0"
8585
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
86-
poiVersion = "5.5.0"
86+
poiVersion = "5.5.1"
8787
// http://mvnrepository.com/artifact/commons-fileupload/commons-fileupload
8888
fileuploadVersion = "1.6.0"
8989
// http://mvnrepository.com/artifact/org.apache.commons/commons-collections4
@@ -93,7 +93,7 @@ subprojects {
9393
// http://mvnrepository.com/artifact/commons-io/commons-io
9494
ioVersion = "2.21.0"
9595
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
96-
textVersion = "1.14.0"
96+
textVersion = "1.15.0"
9797
// https://mvnrepository.com/artifact/org.apache.commons/commons-compress
9898
compressVersion = "1.28.0"
9999
// http://mvnrepository.com/artifact/commons-codec/commons-codec

publiccms-parent/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@
2626
<version.servlet>6.1.0</version.servlet>
2727
<!-- http://mvnrepository.com/artifact/org.springframework/spring-core -->
2828
<!-- https://spring.io/projects/spring-framework -->
29-
<version.spring>7.0.1</version.spring>
29+
<version.spring>7.0.2</version.spring>
3030
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
3131
<!-- https://spring.io/projects/spring-boot -->
3232
<version.springBoot>4.0.0</version.springBoot>
3333
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
3434
<version.juint>6.0.1</version.juint>
3535
<!-- http://mvnrepository.com/artifact/org.hibernate.orm/hibernate-core -->
3636
<!-- http://hibernate.org/orm/releases/ -->
37-
<version.hibernate>7.1.9.Final</version.hibernate>
37+
<version.hibernate>7.2.0.Final</version.hibernate>
3838
<!-- https://mvnrepository.com/artifact/org.hibernate.tool/hibernate-tools-orm -->
39-
<version.hibernateTools>7.1.9.Final</version.hibernateTools>
39+
<version.hibernateTools>7.1.11.Final</version.hibernateTools>
4040
<!-- https://mvnrepository.com/artifact/org.hibernate.search/hibernate-search-mapper-orm/ -->
4141
<!-- http://hibernate.org/search/releases/ -->
42-
<version.hibernateSearch>8.1.2.Final</version.hibernateSearch>
42+
<version.hibernateSearch>8.2.0.Final</version.hibernateSearch>
4343
<!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
4444
<version.hibernateValidator>9.1.0.Final</version.hibernateValidator>
4545
<!-- http://mvnrepository.com/artifact/org.mybatis/mybatis -->
4646
<version.mybatis>3.5.19</version.mybatis>
4747
<!-- http://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
48-
<version.mybatisSpring>3.0.5</version.mybatisSpring>
48+
<version.mybatisSpring>4.0.0</version.mybatisSpring>
4949
<!-- http://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
5050
<version.mybatisGenerator>1.4.2</version.mybatisGenerator>
5151
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper -->
@@ -55,7 +55,7 @@
5555
<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
5656
<version.ehcache>3.11.1</version.ehcache>
5757
<!-- https://mvnrepository.com/artifact/tools.jackson.core/jackson-databind -->
58-
<version.jackson>3.0.2</version.jackson>
58+
<version.jackson>3.0.3</version.jackson>
5959
<!-- http://mvnrepository.com/artifact/org.freemarker/freemarker -->
6060
<version.freemarker>2.3.34</version.freemarker>
6161
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-core -->
@@ -64,7 +64,7 @@
6464
<!-- https://github.com/redis/jedis -->
6565
<version.jedis>7.1.0</version.jedis>
6666
<!-- http://mvnrepository.com/artifact/org.quartz-scheduler/quartz -->
67-
<version.quartz>2.5.1</version.quartz>
67+
<version.quartz>2.5.2</version.quartz>
6868
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
6969
<!-- https://github.com/brettwooldridge/HikariCP -->
7070
<version.hikariCP>7.0.2</version.hikariCP>
@@ -74,7 +74,7 @@
7474
<!-- http://hc.apache.org/downloads.cgi -->
7575
<version.httpclient>4.5.14</version.httpclient>
7676
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
77-
<version.poi>5.5.0</version.poi>
77+
<version.poi>5.5.1</version.poi>
7878
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.poi.xwpf.converter.xhtml -->
7979
<version.xhtmlConverter>2.1.0</version.xhtmlConverter>
8080
<!-- http://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
@@ -86,7 +86,7 @@
8686
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
8787
<version.io>2.21.0</version.io>
8888
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
89-
<version.text>1.14.0</version.text>
89+
<version.text>1.15.0</version.text>
9090
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
9191
<version.compress>1.28.0</version.compress>
9292
<!-- http://mvnrepository.com/artifact/commons-codec/commons-codec -->

publiccms-parent/publiccms-analyzer/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ dependencies {
1010

1111
implementation "org.apache.lucene:lucene-analysis-smartcn:${luceneVersion}"
1212
// https://mvnrepository.com/artifact/org.lionsoul/ip2region
13-
implementation 'org.lionsoul:ip2region:3.1.1'
13+
implementation 'org.lionsoul:ip2region:3.3.1'
1414
implementation "jakarta.servlet:jakarta.servlet-api:${servletVersion}"
1515
}

publiccms-parent/publiccms-analyzer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>org.lionsoul</groupId>
2323
<artifactId>ip2region</artifactId>
24-
<version>3.1.1</version>
24+
<version>3.3.1</version>
2525
</dependency>
2626
<dependency>
2727
<groupId>com.github.therapi</groupId>

publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/tools/CmsFileUtils.java

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.nio.file.attribute.BasicFileAttributes;
1616
import java.util.ArrayList;
1717
import java.util.Arrays;
18+
import java.util.Collection;
1819
import java.util.Collections;
1920
import java.util.Comparator;
2021
import java.util.Date;
@@ -25,6 +26,7 @@
2526
import org.apache.commons.io.FileUtils;
2627
import org.apache.commons.io.IOUtils;
2728
import org.apache.commons.lang3.ArrayUtils;
29+
import org.apache.pdfbox.cos.COSArray;
2830
import org.apache.pdfbox.cos.COSBase;
2931
import org.apache.pdfbox.cos.COSDictionary;
3032
import org.apache.pdfbox.cos.COSName;
@@ -83,28 +85,34 @@ private CmsFileUtils() {
8385
/**
8486
*
8587
*/
86-
public static final String[] DOCUMENT_FILE_SUFFIXS = new String[] { ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".ofd" };
88+
public static final String[] DOCUMENT_FILE_SUFFIXS = new String[] { ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf",
89+
".txt", ".md", ".ofd" };
8790
/**
8891
*
8992
*/
90-
public static final String[] VIDEO_FILE_SUFFIXS = new String[] { ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm" };
93+
public static final String[] VIDEO_FILE_SUFFIXS = new String[] { ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg",
94+
".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm" };
9195
/**
9296
*
9397
*/
94-
public static final String[] OTHER_FILE_SUFFIXS = new String[] { ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", ".psd" };
98+
public static final String[] OTHER_FILE_SUFFIXS = new String[] { ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
99+
".psd" };
95100
/**
96101
*
97102
*/
98-
public static final String[] ALLOW_FILES = ArrayUtils
99-
.addAll(ArrayUtils.addAll(ArrayUtils.addAll(ArrayUtils.addAll(AUDIO_FILE_SUFFIXS, VIDEO_FILE_SUFFIXS), IMAGE_FILE_SUFFIXS), DOCUMENT_FILE_SUFFIXS), OTHER_FILE_SUFFIXS);
103+
public static final String[] ALLOW_FILES = ArrayUtils.addAll(
104+
ArrayUtils.addAll(ArrayUtils.addAll(ArrayUtils.addAll(AUDIO_FILE_SUFFIXS, VIDEO_FILE_SUFFIXS), IMAGE_FILE_SUFFIXS),
105+
DOCUMENT_FILE_SUFFIXS),
106+
OTHER_FILE_SUFFIXS);
100107
/**
101108
*
102109
*/
103110
public static final String[] IMAGE_FILETYPES = new String[] { CmsFileUtils.FILE_TYPE_IMAGE };
104111
/**
105112
*
106113
*/
107-
public static final String[] OTHER_FILETYPES = new String[] { CmsFileUtils.FILE_TYPE_VIDEO, CmsFileUtils.FILE_TYPE_AUDIO, CmsFileUtils.FILE_TYPE_DOCUMENT, CmsFileUtils.FILE_TYPE_OTHER };
114+
public static final String[] OTHER_FILETYPES = new String[] { CmsFileUtils.FILE_TYPE_VIDEO, CmsFileUtils.FILE_TYPE_AUDIO,
115+
CmsFileUtils.FILE_TYPE_DOCUMENT, CmsFileUtils.FILE_TYPE_OTHER };
108116

109117
/**
110118
*
@@ -256,7 +264,8 @@ public static List<FileInfo> getFileList(String dirPath, boolean useFilter, Stri
256264
Path fileNamePath = entry.getFileName();
257265
if (null != fileNamePath) {
258266
String fileName = fileNamePath.toString();
259-
if (!useFilter || !fileName.endsWith(".data") && !TemplateComponent.INCLUDE_DIRECTORY.equalsIgnoreCase(fileName)) {
267+
if (!useFilter
268+
|| !fileName.endsWith(".data") && !TemplateComponent.INCLUDE_DIRECTORY.equalsIgnoreCase(fileName)) {
260269
BasicFileAttributes attrs = Files.readAttributes(entry, BasicFileAttributes.class);
261270
fileList.add(new FileInfo(fileName, attrs.isDirectory(), attrs));
262271
}
@@ -560,20 +569,46 @@ public static boolean isSafe(String filepath, String suffix) {
560569

561570
private static boolean isSafe(List<COSObject> pdfObjects) {
562571
for (COSObject object : pdfObjects) {
563-
COSBase realObject = object.getObject();
564-
if (realObject instanceof COSDictionary) {
565-
COSDictionary dic = (COSDictionary) realObject;
566-
if (null != dic.getDictionaryObject(COSName.JS) || null != dic.getDictionaryObject(COSName.JAVA_SCRIPT)) {
567-
return false;
568-
}
569-
} else if (realObject instanceof COSName && (COSName.JS.equals(realObject) || COSName.JAVA_SCRIPT.equals(realObject))) {
572+
if (isUnSafe(object)) {
570573
return false;
571-
572574
}
573575
}
574576
return true;
575577
}
576578

579+
private static boolean isUnSafe(Collection<COSBase> pdfObjects) {
580+
for (COSBase object : pdfObjects) {
581+
if (isUnSafe(object)) {
582+
return true;
583+
}
584+
}
585+
return false;
586+
}
587+
588+
private static boolean isUnSafe(COSObject object) {
589+
return isUnSafe(object.getObject());
590+
}
591+
592+
private static boolean isUnSafe(COSBase realObject) {
593+
if (realObject instanceof COSDictionary) {
594+
COSDictionary dic = (COSDictionary) realObject;
595+
if (null != dic.getDictionaryObject(COSName.JS) || null != dic.getDictionaryObject(COSName.JAVA_SCRIPT)) {
596+
return true;
597+
}
598+
return isUnSafe(dic.getValues());
599+
} else if (realObject instanceof COSArray) {
600+
COSArray array = (COSArray) realObject;
601+
for (COSBase object : array) {
602+
if (isUnSafe(object)) {
603+
return true;
604+
}
605+
}
606+
} else if (realObject instanceof COSName && (COSName.JS.equals(realObject) || COSName.JAVA_SCRIPT.equals(realObject))) {
607+
return false;
608+
}
609+
return false;
610+
}
611+
577612
/**
578613
* 获取文件内容 Get file content ファイルの内容を取得します
579614
*
@@ -658,7 +693,8 @@ public static String getSuffix(String originalFilename) {
658693
if (null != originalFilename) {
659694
int index = originalFilename.lastIndexOf(Constants.DOT);
660695
if (-1 < index) {
661-
return originalFilename.substring(originalFilename.lastIndexOf(Constants.DOT), originalFilename.length()).toLowerCase();
696+
return originalFilename.substring(originalFilename.lastIndexOf(Constants.DOT), originalFilename.length())
697+
.toLowerCase();
662698
}
663699
}
664700
return null;
@@ -711,7 +747,8 @@ public static String upload(byte[] data, String fileName) throws IllegalStateExc
711747
* @throws IllegalStateException
712748
* @throws IOException
713749
*/
714-
public static String upload(byte[] data, String fileName, String originalName, String metadataPath) throws IllegalStateException, IOException {
750+
public static String upload(byte[] data, String fileName, String originalName, String metadataPath)
751+
throws IllegalStateException, IOException {
715752
File dest = new File(fileName);
716753
dest.getParentFile().mkdirs();
717754
FileUtils.writeByteArrayToFile(dest, data);

publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsContentAdminController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import com.publiccms.logic.component.exchange.ContentExchangeComponent;
6464
import com.publiccms.logic.component.exchange.ContentExportComponent;
6565
import com.publiccms.logic.component.exchange.SiteExchangeComponent;
66+
import com.publiccms.logic.component.site.FileUploadComponent;
6667
import com.publiccms.logic.component.site.SiteComponent;
6768
import com.publiccms.logic.component.site.StatisticsComponent;
6869
import com.publiccms.logic.component.template.ModelComponent;
@@ -127,10 +128,11 @@ public class CmsContentAdminController {
127128
@Resource
128129
private StatisticsComponent statisticsComponent;
129130
@Resource
131+
protected FileUploadComponent fileUploadComponent;
132+
@Resource
130133
private SysWorkflowProcessItemService workflowProcessItemService;
131134
@Resource
132135
private SysWorkflowProcessService workflowProcessService;
133-
134136
/**
135137
* 保存内容
136138
*
@@ -851,7 +853,10 @@ public String distribute(@RequestAttribute SysSite site, @SessionAttribute SysUs
851853
}
852854

853855
if (0 != userId) {
854-
CmsUrlUtils.initContentUrl(site, entity);
856+
if(category.getSiteId() != site.getId()) {
857+
CmsUrlUtils.initContentUrl(site, entity);
858+
fileUploadComponent.initContentCover(site, entity);
859+
}
855860
CmsContent content = service.copy(site, entity, category, status, userId);
856861
if (null != content) {
857862
try {

publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.publiccms.common.handler.FacetPageHandler;
2929
import com.publiccms.common.handler.PageHandler;
3030
import com.publiccms.common.tools.CmsFileUtils;
31+
import com.publiccms.common.tools.CmsUrlUtils;
3132
import com.publiccms.common.tools.CommonUtils;
3233
import com.publiccms.common.tools.ControllerUtils;
3334
import com.publiccms.common.tools.ExtendUtils;
@@ -42,6 +43,7 @@
4243
import com.publiccms.entities.sys.SysExtendField;
4344
import com.publiccms.entities.sys.SysSite;
4445
import com.publiccms.entities.sys.SysUser;
46+
import com.publiccms.logic.component.site.FileUploadComponent;
4547
import com.publiccms.logic.dao.cms.CmsContentDao;
4648
import com.publiccms.logic.dao.cms.CmsContentSearchDao;
4749
import com.publiccms.logic.service.sys.SysExtendFieldService;
@@ -118,6 +120,8 @@ public class CmsContentService extends BaseService<CmsContent> {
118120
private CmsContentAttributeService attributeService;
119121
@Resource
120122
private CmsContentRelatedService cmsContentRelatedService;
123+
@Resource
124+
protected FileUploadComponent fileUploadComponent;
121125

122126
/**
123127
* @param queryEntity
@@ -935,6 +939,9 @@ public CmsContent copy(SysSite site, CmsContent content, CmsCategory category, i
935939
contentFile.setUserId(userId);
936940
resultList.add(contentFile);
937941
}
942+
if(category.getSiteId() != site.getId()) {
943+
resultList.forEach(e -> e.setFilePath(CmsUrlUtils.getUrl(fileUploadComponent.getPrefix(site), e.getFilePath())));
944+
}
938945
contentFileService.save(resultList);
939946
}
940947
@SuppressWarnings("unchecked")
@@ -950,6 +957,9 @@ public CmsContent copy(SysSite site, CmsContent content, CmsCategory category, i
950957
contentProduct.setUserId(userId);
951958
resultList.add(contentProduct);
952959
}
960+
if(category.getSiteId() != site.getId()) {
961+
resultList.forEach(e -> e.setCover(CmsUrlUtils.getUrl(fileUploadComponent.getPrefix(site), e.getCover())));
962+
}
953963
contentProductService.save(resultList);
954964
}
955965
return entity;

publiccms-parent/publiccms-core/src/main/resources/initialization/sql/V4.0.202406-V4.0.202506.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,6 @@ INSERT INTO `sys_module_lang` VALUES ('place_import', 'ja', '導入');
340340
INSERT INTO `sys_module_lang` VALUES ('place_import', 'zh', '导入');
341341
-- 2025-06-25 --
342342
DELETE FROM sys_module_lang WHERE module_id in ('myself_content_view','myself_process_view');
343-
UPDATE sys_module SET menu = 0 WHERE id = 'content_check';
343+
UPDATE sys_module SET menu = 0 WHERE id = 'content_check';
344+
--2025-12-05 --
345+
UPDATE sys_module SET has_child = 1 WHERE id = 'myself_profile';

0 commit comments

Comments
 (0)