[Rt-commit] r6521 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Sun Nov 26 17:45:02 EST 2006
Author: ruz
Date: Sun Nov 26 17:45:02 2006
New Revision: 6521
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/html/Elements/ScrubHTML
Log:
r4178 at cubic-pc: cubic | 2006-11-27 01:49:37 +0300
r3511 at cubic-pc: cubic | 2006-06-29 06:35:23 +0400
* init scrubber object only once
Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/ScrubHTML
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/ScrubHTML (original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/ScrubHTML Sun Nov 26 17:45:02 2006
@@ -43,9 +43,8 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<%init>
-my $scrubber = HTML::Scrubber->new();
-
+<%ONCE>
+my $scrubber = new HTML::Scrubber;
$scrubber->default(
0,
{
@@ -57,15 +56,17 @@
href => qr{^(?:http:|ftp:|https:|/|__Web(?:Path|BaseURL|URL)__)}i,
face => 1,
size => 1,
- target => 1
+ target => 1,
}
);
-
$scrubber->deny(qw[*]);
$scrubber->allow(
- qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD PRE]);
+ qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD PRE]
+);
$scrubber->comment(0);
-return ( $scrubber->scrub($Content) );
+</%ONCE>
+<%init>
+return $scrubber->scrub($Content);
</%init>
<%args>
$Content => undef
More information about the Rt-commit
mailing list