e6eaaaa2b64a0ac14f17f5011f27f294d5287a23 lrnassar Wed Sep 9 16:30:48 2026 -0700 Escape the ampersands in the BLAT share box and rename dialog hgSession hrefs. Feedback from CR. refs #38292 diff --git src/hg/js/hgBlat.js src/hg/js/hgBlat.js index 6f9923b1ea0..e0ef26a2c03 100644 --- src/hg/js/hgBlat.js +++ src/hg/js/hgBlat.js @@ -296,31 +296,31 @@ box.style.display = 'flex'; if (msg) { box.innerHTML = '' + htmlEncode(msg) + ''; return; } if (!url) { box.innerHTML = 'Creating link…'; return; } box.innerHTML = 'Anyone with this shareable link can open ' + 'these BLAT results. It stores only the results, not your other tracks or settings. The ' + 'link remains valid for years; to keep your results permanently, save them into a ' + `Session.` + + `&hgsid=${encodeURIComponent(hgBlatData.config.hgsid || '')}">Session.` + '' + ''; var inp = document.getElementById('gbShareInput'); inp.value = url; inp.focus(); inp.select(); $('#blatShareCopy').on('click', function() { inp.select(); if (navigator.clipboard) { navigator.clipboard.writeText(url); } else { document.execCommand('copy'); } this.textContent = 'Copied'; }); } function blatShareLink() { @@ -367,31 +367,31 @@ if (blatShareBoxOpen(box)) blatShowShareBox(box, null, 'Could not reach the server. Please try again.'); }); } // ---- Rename BLAT track (modal) ------------------------------------------- // The results custom track is built (and renamed) by hgBlat.c's inline code, which exposes a small // window.blatRenameCt(name, description) helper (it POSTs to hgc's buildBigPsl and rebuilds the // track). We reuse that helper (no new endpoint), just swapping its old inline toggle-form UI for a // proper modal dialog. The current name/description come from cfg (hgBlat.c), not a global, so this // does not depend on any generic page-global. function blatRenameModalHtml(cfg) { // hgSession link is relative (same /cgi-bin/), carrying db + hgsid so the session page opens in // this assembly and cart. - var sessionUrl = `hgSession?db=${encodeURIComponent(cfg.db)}&hgsid=${encodeURIComponent(cfg.hgsid)}`; + var sessionUrl = `hgSession?db=${encodeURIComponent(cfg.db)}&hgsid=${encodeURIComponent(cfg.hgsid)}`; return ''; }