kl
d0a0700275
fix: reject control characters in FTP command arguments
2026-10-08 14:04:15 +08:00
kl
567c8b949a
Merge master into watermark defaults fix
2026-10-08 13:48:15 +08:00
kl
5e3c013e38
Merge pull request #795 from wylovelyi/fix/issue-790-js-escape
...
fix: escape preview URLs and resolve Office schema conflicts
2026-10-08 13:19:56 +08:00
kl
1acd4e4ecd
fix: exclude legacy schemas from Office preview dependencies
2026-10-08 13:14:52 +08:00
kl
1dfad8860f
Merge pull request #798 from wylovelyi/fix/issue-787-image-preview-filename
...
fix(#787 ): show filename in image preview title via data-original-url
2026-10-08 13:07:11 +08:00
kl
7ef274d376
fix: preserve spreadsheet URLs for JavaScript escaping
2026-10-08 13:04:51 +08:00
kl
86c2b8d552
fix: retain original image titles when proxying previews
2026-10-08 13:02:39 +08:00
wylovelyi
6b948fa675
fix( #787 ): make the image-preview title actually derive from the original URL
...
Verified against the bundled viewer.min.js: the `title(image, imageData)` callback
receives the <img> element Viewer.js creates internally (view(): `var image =
document.createElement('img')`), NOT the original <div>. Viewer only forwards the
attributes listed in `inheritedAttributes` (default: crossOrigin, decoding, isMap,
loading, referrerPolicy, sizes, srcset, useMap) when building that <img>, and
`data-original-url` is not in that list. So the previous title function always read
null and the title stayed 'image' -- the fix was a no-op at runtime.
Fix: add `data-original-url` to Viewer's `inheritedAttributes` so the original URL is
forwarded from the thumbnail <img> to the title <img>, letting
`getImageNameFromOriginalUrl` return the real filename (and not the CORS-proxy URL).
Also updates PictureFilePreviewTests to assert `inheritedAttributes` is configured
with data-original-url, locking the regression.
2026-10-08 10:00:00 +00:00
yuhaibo
45d7e34678
fix: officeweb.ftl 数值水印缺省值改为字符串,避免按 locale 格式化
...
上一版给六个数值水印变量用的是数值缺省值(${watermarkAlpha!0.2} 等)。
FreeMarker 按请求的 locale 格式化数值:Accept-Language 为 de-DE / fr-FR 时
0.2 输出成 0,2,ar-EG 时数字变成阿拉伯-印度数字,内联脚本解析失败,
initWaterMark 与 isLoading 都没有定义,xlsx 预览照样起不来——而此时响应是 200、
页面也有 </html>,只看页面完整性看不出来。
改为字符串缺省值,与 WatermarkConfigConstants.DEFAULT_* 的类型一致,原样输出。
已配置的值本来就是字符串,不受影响。
测试改为按 zh-CN / en-US / de-DE / fr-FR / ar-EG 逐个渲染,并逐个断言全部数值
输出;已有配置那条也按 zh-CN / de-DE / ar-EG 跑。改模板前先跑:de-DE、fr-FR
红在 watermark_alpha: 0,2,ar-EG 红在 watermark_x_space: ١٠,其余五条通过;
改后 8 条全过。
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com >
2026-09-27 08:48:33 -07:00
wylovely
ae7cdf3963
test( #790 ): assert JS-escaping of file URL across all 14 preview templates
2026-09-24 15:41:22 +08:00
wylovely
80b13dacba
fix( #787 ): derive Viewer title from data-original-url so image preview shows the filename (was empty for <div src>)
2026-09-24 15:27:12 +08:00
baiyu-jujuc
c1b9daa561
fix: avoid NPE when previewing images with redis cache
...
CacheServiceRedisImpl#getImgCache(String) passed the key straight to Redisson, which throws NullPointerException (map key can't be null) for a null key. Every single-image preview hits this path because compressFileKey is only set for images inside an archive, so with cache.type=redis the preview endpoint always returned HTTP 500. Return an empty list for empty keys, matching CacheServiceJDKImpl.
Fixes #793
2026-09-23 14:01:57 +08:00
wylovely
016a040461
test( #790 ): add regression test asserting file URL is JS-escaped in preview template
2026-09-22 09:17:43 +08:00
yuhaibo
c4e1929ecf
fix: 水印配置缺失时 xlsx 预览白页 —— officeweb.ftl 补上缺省值
...
未提供外部 config/application.properties 的部署上,预览任何 xlsx 都失败:
FreeMarker 在 officeweb.ftl 第 25 行抛 InvalidReferenceException,点名
watermarkTxt。DEBUG 模式把错误内联进 HTML,页面断在半截 JavaScript 里、
永远没有 </html>,浏览器上是白页或一直转圈,而 HTTP 状态码是 200 ——
看起来像转换超时,不像模板错。
两处叠在一起:
1. 十个 watermark* 请求属性可能整族不存在。WatermarkConfigConstants 没有
类级注解(对比 ConfigConstants 上的 @Component),不是 Spring bean,
那十个 @Value 的 setter 从来不会被调用;唯一填充它们的
ConfigRefreshComponent#loadConfig() 在配置文件不存在时直接 return。
于是十个 getter 全返回 null,AttributeSetFilter 的
setAttribute(name, null) 按 Servlet 规范等同于删除属性。
2. officeweb.ftl 是唯一没有 classic_compatible 兜底的预览模板。
commonHeader.ftl 第 1 行是 <#setting classic_compatible=true>,
所有 include 它的模板在属性缺失时把变量渲染成空串、照常出页面;
officeweb.ftl 既不 include 它、自己也没有这个设置。
缺省值取 WatermarkConfigConstants.DEFAULT_*,watermarkTxt 取空串——
空串会让下一行的 if (watermarkTxt !== '') 跳过 watermark.init(),不会给
所有预览凭空加上水印。其余九个只在水印开着时才用到,但那个 if 是
JavaScript 的、不是模板的,FreeMarker 两条分支都渲染,所以十个都要给。
新增的测试直接用 FreeMarker 渲染这个模板,不需要把服务跑起来:
数据模型里一个 watermark* 都不给(那正是缺陷发生时的情形),断言渲染得出
</html>;另一条把十个值全给上,断言逐个原样渲染,保证缺省值不会盖掉真实配置。
改模板之前先跑过一遍,第一条报 InvalidReferenceException、第二条通过。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-09-08 00:54:15 -07:00
kl
a199b4a7fe
fix: honor custom watermark settings in PDF preview
2026-08-25 08:39:11 +08:00
kl
69b234fda2
Merge commit from fork
...
Fix insecure default file deletion
2026-08-14 14:14:37 +08:00
kl
f852bf844b
fix: secure demo file deletion
2026-08-14 11:12:50 +08:00
kl
583208898f
fix: sandbox HTML preview execution
2026-08-14 11:12:50 +08:00
kl
257180eb95
fix: refresh ImageIO plugins before PDF conversion
2026-08-11 12:54:50 +08:00
kl
47745e4d74
Merge commit from fork
2026-07-13 16:53:58 +08:00
kl
32a887aa2c
fix: protect addTask with trust filters ( #767 )
2026-06-24 14:19:20 +08:00
kl
fd78fe9a6e
test/docs: adjust PDF sidebar config test for conditional default ( #756 )
2026-04-30 18:50:39 +08:00
kl
a8a08c1dcc
Address PR review feedback
2026-04-13 21:02:59 +08:00
kl
7757729efd
Refine archive preview and PDF defaults
2026-04-13 20:54:27 +08:00
copilot-swe-agent[bot]
530304b832
test: use junit assertions for pdf viewer compatibility
...
Agent-Logs-Url: https://github.com/kekingcn/kkFileView/sessions/287f0212-d368-4b59-ae70-0374fb3fe76f
Co-authored-by: klboke <18591662+klboke@users.noreply.github.com >
2026-04-09 02:48:24 +00:00
copilot-swe-agent[bot]
5499150395
fix: add pdfjs at compatibility polyfill
...
Agent-Logs-Url: https://github.com/kekingcn/kkFileView/sessions/287f0212-d368-4b59-ae70-0374fb3fe76f
Co-authored-by: klboke <18591662+klboke@users.noreply.github.com >
2026-04-09 02:46:24 +00:00
kl
8c3bc81e08
fix(security): support wildcard/cidr host pattern matching ( #710 )
...
* fix(security): support wildcard/cidr host pattern matching
* fix(security): harden host matching against null and DNS rebinding
* fix(security): handle ipv4 unsigned range and deny template fallback
* test(security): verify CIDR matching for IPv4 upper boundary
* fix(security): set UTF-8 deny response and use Locale.ROOT
* fix(security): enforce whitelist with blacklist and harden wildcard rules
2026-03-03 15:26:35 +08:00
陈精华
05a8bff1e0
优化:调整单元测试
2025-03-31 15:56:50 +08:00
“yaya”
42cf6b2955
fix: 增大小文本文件检测字符编码的正确率;处理并发隐患
2023-10-06 16:22:32 +08:00
asiawu
31c7b2dfb8
重构了EncodingDetectors#getJavaEncode(String filePath)方法,并附带部分测试数据
...
重构了EncodingDetectors#getJavaEncode(String filePath)方法,并附带部分测试数据
Co-authored-by: asiawu <asiawu3@qq.com >
Co-committed-by: asiawu <asiawu3@qq.com >
2023-07-24 17:15:07 +08:00
陈精华
ba7b6eed4a
修复使用http文件流下载时文件名编码异常Gitee-#I4W0TQ
2022-03-10 09:47:05 +08:00
jerrykcode
f2d5f4a86c
为WebUtils.encodeUrlFileName方法添加测试用例
2021-08-20 14:15:42 +08:00
kl
679459f53b
更新 spring-boot 到最新的 v2.4.2 版本
2021-02-07 18:34:35 +08:00
chenkailing
41cdc227b3
调整项目模块,jodconverter-core重命名为office-plugin。jdocnverter-web重命名为server
2020-12-26 17:42:40 +08:00