SproutCMS

This is the code documentation for the SproutCMS project

function limitedSubsetHtml()

Encode HTML so it's suitable for direct output, but allow some HTML tags to be left as-is

Only a limited subset of tags are left alone, all other tags are stripped.
Allowed tags: A, B, I, STRONG, EM, BR, IMG, SPAN, ABBR, SUP, SUB

The algorithm used in this method is quite simple, so this method should not be used
as a defence against XSS attacks; it should only be used on trusted input such as Form helptext.

Usage

string Text::limitedSubsetHtml ( string $html );

Arguments

  1. string $html
    Plain text or HTML which may contain various tags

Return value

  • string
    HTML which only contains safe tags