File: jvn53973084.t

package info (click to toggle)
libhtml-scrubber-perl 0.09-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 272 kB
  • sloc: perl: 708; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Tests related to JVN53973084

use strict;
use warnings;
use Test::More;

use_ok('HTML::Scrubber');

my @allow = qw[
    hr
];

my $html_1 = q[<hr><a href="javascript:alert(1)"<hr>abc];
my $html_2 = q[<img src="javascript:alert(1)"];
foreach my $comment_value ( 0, 1 ) {
    my $scrubber = HTML::Scrubber->new( allow => \@allow, comment => $comment_value );
    is( $scrubber->scrub($html_1), '<hr>abc', "correct result (1) - with comment => $comment_value" );
    is( $scrubber->scrub($html_2), '',            "correct result (2) - with comment => $comment_value" );
}

done_testing;