| 1 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | package HTML::FormFu::Filter::HTMLScrubber; | ||||||||||
| 4 | 4 | $HTML::FormFu::Filter::HTMLScrubber::VERSION = '2.09'; | |||||||||
| 5 | # ABSTRACT: filter removing HTML markup | ||||||||||
| 6 | |||||||||||
| 7 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | ▶ | use MooseX::Attribute::Chained; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | extends 'HTML::FormFu::Filter'; | |||||||||
| 10 | |||||||||||
| 11 | 4 | ▶ | use Clone (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 4 | has allow => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 14 | 4 | has comment => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 15 | 4 | has default => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 16 | 4 | has rules => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 17 | 4 | has script => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 18 | |||||||||||
| 19 | 4 | ▶ | use HTML::Scrubber; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 3 | ▶ | sub filter { | ||||||||
|
Subroutine
filter: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 22 | 3 | my ( $self, $value ) = @_; | |||||||||
| 23 | |||||||||||
| 24 | 3 | ▶ | return if !defined $value; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | |||||||||||
| 26 | 3 | my %params = ( allow => 0 ); | |||||||||
| 27 | 3 | foreach (qw(allow comment default rules script)) { | |||||||||
| 28 | 15 | my $val = $self->$_; | |||||||||
| 29 | 15 | ▶ | $params{$_} = $val if ( defined($val) ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 3 | my $scrubber = HTML::Scrubber->new(%params); | |||||||||
| 33 | |||||||||||
| 34 | 3 | return $scrubber->scrub($value); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub clone { | ||||||||
|
Subroutine
clone: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 38 | 0 | my $self = shift; | |||||||||
| 39 | |||||||||||
| 40 | 0 | my $clone = $self->SUPER::clone(@_); | |||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | $clone->allow( Clone::clone $self->allow ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | if ref $self->allow; | ||||||||||
| 44 | |||||||||||
| 45 | 0 | return $clone; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 49 | |||||||||||
| 50 | 4 | 1; | |||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||