Commit Graph

608 Commits

Author SHA1 Message Date
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
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
wylovely
d332dbed6a 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:10 +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
wylovely
6fa1d91296 fix(#790): escape file URL in pdf.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:14:19 +08:00
wylovely
0094514fa7 fix(#790): escape file URL in xmind.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:45 +08:00
wylovely
7a2250cc62 fix(#790): escape file URL in tiff.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:42 +08:00
wylovely
67b71de330 fix(#790): escape file URL in svg.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:38 +08:00
wylovely
228ac8e3a0 fix(#790): escape file URL in online3D.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:35 +08:00
wylovely
f47e4b8a96 fix(#790): escape file URL in officeweb.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:32 +08:00
wylovely
e8f1fff879 fix(#790): escape file URL in ofd.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:30 +08:00
wylovely
29ec82554e fix(#790): escape file URL in msg.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:26 +08:00
wylovely
94da3209fc fix(#790): escape file URL in epub.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:24 +08:00
wylovely
ab4542ca65 fix(#790): escape file URL in eml.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:22 +08:00
wylovely
3096ef8368 fix(#790): escape file URL in drawio.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:19 +08:00
wylovely
73437824be fix(#790): escape file URL in dcm.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:16 +08:00
wylovely
e34e281461 fix(#790): escape file URL in csv.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:14 +08:00
wylovely
b81cb91d67 fix(#790): escape file URL in bpmn.ftl with ?js_string to prevent SyntaxError on apostrophe 2026-09-22 09:13:12 +08:00
木火
bf11e7d3c1 fix(ofd):update cnofd viewer for OFD compatibility 2026-08-27 21:51:03 +08:00
kl
a199b4a7fe fix: honor custom watermark settings in PDF preview 2026-08-25 08:39:11 +08:00
kl
e2bcb67d43 chore(release): prepare v5.0.2 2026-08-14 14:28:41 +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
3a08031929 chore(release): prepare v5.0.1 2026-07-13 17:12:40 +08:00
kl
47745e4d74 Merge commit from fork 2026-07-13 16:53:58 +08:00
Spencer.Chang
67c6ba3b13 Optimize LuckyExcel xlsx preview conversion with Web Worker (#766)
* Optimize LuckyExcel conversion with worker

* Fallback LuckyExcel worker errors to main thread
2026-06-29 11:20:50 +08:00
kl
32a887aa2c fix: protect addTask with trust filters (#767) 2026-06-24 14:19:20 +08:00
gaoxingzaq
1f60e30f09 优化:区分 HTTP 错误,返回明确原因 (#752)
* 优化:区分 HTTP 错误,返回明确原因

* 修复 缓存关闭共享的 client,会导致后续请求失败

* 修复 缓存关闭共享的 client,会导致后续请求失败

---------

Co-authored-by: 高雄 <admin@cxcp.com>
2026-05-09 15:04:25 +08:00
Lanwood
4474ab1d57 fix(xlsx): 修复 LuckyExcel 解析数据校验时 matchType 未映射导致的崩溃 (#730)
* fix(xlsx): 修复 LuckyExcel 解析数据校验时 matchType 未映射导致的崩溃

* fix(xlsx): improve matchType handling in data verification logic

* fix(xlsx): simplify matchType mapping logic in LuckySheet class

---------

Co-authored-by: 何武德 <hewude@ruijie.com.cn>
2026-05-09 15:03:26 +08:00
kl
fd78fe9a6e test/docs: adjust PDF sidebar config test for conditional default (#756) 2026-04-30 18:50:39 +08:00
kl
cdce432740 feat: make pdf sidebar default open configurable (#755) 2026-04-30 18:36:40 +08:00
陈精华
4ea1d7468a Merge pull request #746 from gaoxingzaq/pdfjs2
pdf 添加跨域功能 修复pdf 页码和高亮没启用bug
2026-04-29 14:22:00 +08:00
高雄
4cf19d1dbe 优化结构 去掉JQ脚本 内置水印脚本 2026-04-25 08:45:22 +08:00
高雄
3abf864184 修复 pdf无法打印问题 修复pdf打印添加水印问题 2026-04-24 16:42:19 +08:00
高雄
e7fe1afe19 修复:1、redis报错、统一了所有模式(单机、集群、主从、哨兵)的配置参数:都设置了 retryAttempts, retryInterval, timeout, connectTimeout, idleConnectionTimeout, 连接池大小等。3、地址自动补齐协议前缀:normalizeAddress() 方法自动添加 redis://,用户配置可以省略, 其他等等。 2026-04-21 14:08:16 +08:00
高雄
cd2abb4be1 修复反代后 绝对路径错误 2026-04-17 17:37:03 +08:00
高雄
dd803126dd 修复反代后 绝对路径错误 2026-04-16 17:32:09 +08:00
高雄
633e47b765 修复反代后 绝对路径错误 2026-04-16 17:26:41 +08:00
高雄
c52d80c123 修复水印和高亮 特殊符号会导致解析失败问题 2026-04-16 11:21:59 +08:00
高雄
ee2a27501b pdf 添加跨域功能 修复pdf 页码和高亮没启用bug 2026-04-15 14:40:41 +08:00
kl
76e091900b Complete 5.0.0 release notes from v4.4.0 diff 2026-04-14 09:07:18 +08:00