feat(tickets): make ticket title/content/reply length limits configurable

Add ticket_title_max / ticket_content_max / ticket_reply_max to the
users/ticket schema (PHP + SPA) with clamped TicketSettings readers.
All write paths (front REST, admin REST, note REST, native admin page)
and front-end maxlength/counters now read the configured limits.
Remove the hardcoded TICKET_CONTENT_MAX constant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 23:06:28 +08:00
1 parent 6681b0c306
commit 63ab8b8fc9
13 files changed
+71 -28

No files matched your search

+7
View File
@@ -35,6 +35,12 @@
return parseInt(settings().attachmentMax, 10) || 5;
}
/** 字数上限(后台「工单中心 → 提交设置」配置,PHP 侧已夹取边界)。 */
function lengthMax(kind) {
var defaults = { title: 200, content: 5000, reply: 3000 };
return parseInt(settings()[kind + 'Max'], 10) || defaults[kind];
}
function escapeHtml(value) {
return String(value === null || value === undefined ? '' : value)
.replace(/&/g, '&amp;')
@@ -359,6 +365,7 @@
settings: settings,
attachmentEnabled: attachmentEnabled,
attachmentMax: attachmentMax,
lengthMax: lengthMax,
escapeHtml: escapeHtml,
notyf: notyf,
request: request,