RT 5.0.3 Documentation

RT::Interface::Web::Scrubber

Go to latest version →

NAME

RT::Interface::Web::Scrubber

DESCRIPTION

This is a subclass of HTML::Scrubber which automatically configures itself with a sane and safe default set of rules. Additionally, it ensures that the input is balanced HTML by use of the HTML::Gumbo on the input to "scrub".

VARIABLES

These variables can be altered by creating a Scrubber_Local.pm file, containing something of the form:

    package RT::Interface::Web::Scrubber;

    # Allow the "title" attribute
    $ALLOWED_ATTRIBUTES{title} = 1;
@ALLOWED_TAGS

Passed to "allow" in HTML::Scrubber.

%ALLOWED_ATTRIBUTES

Passed into "default" in HTML::Scrubber.

%RULES

Passed to "rules" in HTML::Scrubber.

METHODS

new

Returns a new RT::Interface::Web::Scrubber object, configured with the above globals. Takes no arguments.

gumbo

Returns a HTML::Gumbo object.

scrub TEXT

Takes a string of HTML, and returns it scrubbed, via HTML::Gumbo then the rules. This is a more limited interface than "scrub" in HTML::Scrubber.

← Back to index