RT::Interface::Web::Scrubber
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".
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.
Returns a new RT::Interface::Web::Scrubber object, configured with the above globals. Takes no arguments.
Returns a HTML::Gumbo object.
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.
Accepts a second boolean argument to optionally skip the initial HTML::Gumbo check. Pass 1 (true) to skip this check. The default is false.
← Back to index