php-content/Models
Snider fa4893d064 fix(security): require HTMLPurifier for XSS sanitisation
The previous getSanitisedContent() method fell back to strip_tags() when
HTMLPurifier was unavailable. This fallback was insecure as strip_tags()
does not sanitise attributes, allowing XSS via onclick, onerror, and
javascript: URLs.

Changes:
- Created Services/HtmlSanitiser.php using HTMLPurifier as the sole sanitiser
- Added ezyang/htmlpurifier as a required dependency in composer.json
- Added boot-time validation that throws RuntimeException if missing
- Removed insecure strip_tags() fallback from ContentItem model
- Added 30+ unit tests covering XSS attack vectors

Closes SEC-002 from TODO.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:34:35 +00:00
..
AIUsage.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentAuthor.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentBrief.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentItem.php fix(security): require HTMLPurifier for XSS sanitisation 2026-01-29 12:34:35 +00:00
ContentMedia.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentRevision.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentTask.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentTaxonomy.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentWebhookEndpoint.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00
ContentWebhookLog.php refactor: update namespaces for L1/L2 package convention 2026-01-27 17:34:49 +00:00