O'Reilly logo

Sams Teach Yourself Movable Type in 24 Hours by Porter Glendinning, Molly E. Holzschlag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Sanitize

The main thing Sanitize does is to remove from a piece of content any HTML or XHTML markup that has not been explicitly allowed. Sanitize acts as a bouncer with a guest list that says which elements and element attributes are allowed in; if the content being sanitized contains an element or attribute that's not on the list, Sanitize strips out the unlisted element or attribute.

This filtering doesn't have any effect on the data that is actually stored in Movable Type's database, only on the content that is actually published to your site when using a template tag that inserts that data. For example, let's say the database contained a value that looked something like this:

 <p>This is a paragraph that contains <span class="foo">a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required