Skip to content

DataTables: harden esc() to escape quotes (attribute-safe) - #136

Merged
WebTigers merged 1 commit into
mainfrom
fix/harden-datatable-esc
Aug 17, 2026
Merged

DataTables: harden esc() to escape quotes (attribute-safe)#136
WebTigers merged 1 commit into
mainfrom
fix/harden-datatable-esc

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

tigerDataTable.esc escaped & < > (via text→innerHTML) but not quotes, so a column render dropping row data into a data-* attribute could break out of it — the root of the skills grid Install/Source JSON.parse failure.

  • Harden esc() to escape & < > " ' in a single pass, so it's safe for both element text and attribute values. Matches the other house escapers (tiger.media-picker.js, tiger-upload-list.js), and drops the jQuery dependency for escaping.
  • Remove the skills view's now-redundant local attr() workaround — esc() is attribute-safe on its own.

Strictly safer for every existing caller (Users, Orgs, Code, CMS, Media, Skills): &quot;/&#39; render as "/' in text contexts, and are now correct in attribute contexts. Verified single-pass (no double-escaping of &). Deployed to tiger-dev.

🤖 Generated with Claude Code

tigerDataTable.esc used text→innerHTML, which escapes & < > but NOT quotes, so
dropping row data into a data-* attribute could break out of it (the skills
Install/Source JSON-in-attribute bug). Escape & < > " ' in a single pass —
matching the other house escapers (tiger.media-picker.js, tiger-upload-list.js)
— so a render can put row data straight into an attribute safely.

Also drops the skills view's now-redundant local attr() workaround; esc() is
attribute-safe on its own.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@WebTigers
WebTigers merged commit b54aba1 into main Aug 17, 2026
13 of 35 checks passed
@WebTigers
WebTigers deleted the fix/harden-datatable-esc branch August 17, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant