// XSS prevention helper — delegates to lt.escHtml() from web_template/base.js function escapeHtml(text) { return lt.escHtml(text); } // Get ticket ID from URL (handles both /ticket/123 and ?id=123 formats) function getTicketIdFromUrl() { const pathMatch = window.location.pathname.match(/\/ticket\/(\d+)/); if (pathMatch) return pathMatch[1]; const params = new URLSearchParams(window.location.search); return params.get('id'); }