summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/ScrubHTML
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-07-02 14:24:21 -0700
committerIvan Kohler <ivan@freeside.biz>2012-07-02 14:24:21 -0700
commit85e677b86fc37c54e6de2b06340351a28f5a5916 (patch)
tree11148e2c292bd1a43b7cf6c2f5212a6ca8b03e75 /rt/share/html/Elements/ScrubHTML
parente5ab051ccdb7637d8dd2f0ed9b4fe9aaaf1d1100 (diff)
parent92aedddd3684167abb60cd3f1d77bbc156c592e6 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/share/html/Elements/ScrubHTML')
-rw-r--r--rt/share/html/Elements/ScrubHTML28
1 files changed, 2 insertions, 26 deletions
diff --git a/rt/share/html/Elements/ScrubHTML b/rt/share/html/Elements/ScrubHTML
index 87aaaf387..47d125d89 100644
--- a/rt/share/html/Elements/ScrubHTML
+++ b/rt/share/html/Elements/ScrubHTML
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -45,32 +45,8 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<%ONCE>
-my $scrubber = new HTML::Scrubber;
-$scrubber->default(
- 0,
- {
- '*' => 0,
- id => 1,
- class => 1,
- # Match http, ftp and relative urls
- # XXX: we also scrub format strings with this module then allow simple config options
- href => qr{^(?:http:|ftp:|https:|/|__Web(?:Path|BaseURL|URL)__)}i,
- face => 1,
- size => 1,
- target => 1,
- style => qr{^(?:(?:color:\s*rgb\(\d+,\s*\d+,\s*\d+\))|
- (?:text-align:\s*))}ix,
- }
-);
-$scrubber->deny(qw[*]);
-$scrubber->allow(
- qw[A B U P BR I HR BR SMALL EM FONT SPAN STRONG SUB SUP STRIKE H1 H2 H3 H4 H5 H6 DIV UL OL LI DL DT DD PRE]
-);
-$scrubber->comment(0);
-</%ONCE>
<%init>
-return $scrubber->scrub($Content);
+return ScrubHTML($Content);
</%init>
<%args>
$Content => undef