htmLawed, script / software to secure / sanitize / purify / filter HTML / XHTML using PHP

PHP Labware internal utilities / home | November 24, 2025
Download
146 kb zip file
v1.2.15, 4 Aug '23
source code
Documentation
readme
Discuss
forum
htmLawed
PHP code to purify & filter HTML

  • make HTML secure and compliant with standards and admin policy
  • one file, no dependency, works in PHP 4.4 too!
  • process text for use in HTML or XML documents
  • restrict HTML elements, attributes, URLs, etc. with block/allow rules
  • balance tags, check element nesting, transform deprecated attributes and tags, make relative URLs absolute, etc.
  • fast, highly customizable, well-documented
  • open-source, dual LGPL-3 and GPL-2+ licensing
  • simple HTML Tidy alternative
  • use to filter, secure & sanitize HTML in blog comments or forum posts, generate XML-compatible feed items from web-page excerpts, convert HTML to XHTML, pretty-print HTML, scrape web-pages, reduce spam, remove XSS code, etc.

more ...

AltStyle によって変換されたページ (->オリジナル) /