|
@@ -82,6 +82,7 @@ public class ArticleService extends BaseTransaction {
|
|
|
private static final Long NAVIGATION_STYLE_TEXT_LIST = 10000L;
|
|
private static final Long NAVIGATION_STYLE_TEXT_LIST = 10000L;
|
|
|
private static final Long NAVIGATION_STYLE_GRAPHIC_LIST = 10010L;
|
|
private static final Long NAVIGATION_STYLE_GRAPHIC_LIST = 10010L;
|
|
|
private static final String ARTICLE_DEFAULT_THUMBNAIL = "/main/images/article-default-thumbnail.jpg";
|
|
private static final String ARTICLE_DEFAULT_THUMBNAIL = "/main/images/article-default-thumbnail.jpg";
|
|
|
|
|
+ private static final int MAX_INLINE_IMAGE_LENGTH = 256 * 1024;
|
|
|
private static final String COLLEGE_RED_TEMPLATE_ID_CODE = "ffkjcollegered1";
|
|
private static final String COLLEGE_RED_TEMPLATE_ID_CODE = "ffkjcollegered1";
|
|
|
private static final String ARTICLE_PUBLISHED_HISTORY_ROOT = "/web/upload/article-history/";
|
|
private static final String ARTICLE_PUBLISHED_HISTORY_ROOT = "/web/upload/article-history/";
|
|
|
private static final String PUBLISHED_CONTENT_SNAPSHOT_FIELD = "publishedContentSnapshot";
|
|
private static final String PUBLISHED_CONTENT_SNAPSHOT_FIELD = "publishedContentSnapshot";
|
|
@@ -230,6 +231,15 @@ public class ArticleService extends BaseTransaction {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ boolean oversizedInlineImage = (StringUtil.notNull(src) && src.startsWith("data:image/")
|
|
|
|
|
+ && src.length() > MAX_INLINE_IMAGE_LENGTH)
|
|
|
|
|
+ || (StringUtil.notNull(originalSrc) && originalSrc.startsWith("data:image/")
|
|
|
|
|
+ && originalSrc.length() > MAX_INLINE_IMAGE_LENGTH);
|
|
|
|
|
+ if (oversizedInlineImage) {
|
|
|
|
|
+ setResponsePackage(getResponseWarningMsgPackage("正文中存在过大的内嵌图片,请使用图片上传功能改为静态资源后保存"));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String effectiveSource = StringUtil.notNull(src) && !src.startsWith("data:") ? src : originalSrc;
|
|
String effectiveSource = StringUtil.notNull(src) && !src.startsWith("data:") ? src : originalSrc;
|
|
|
String localPath = extractLocalUploadPath(effectiveSource);
|
|
String localPath = extractLocalUploadPath(effectiveSource);
|
|
|
if (StringUtil.notNull(localPath)) {
|
|
if (StringUtil.notNull(localPath)) {
|