__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/usr/bin/perl
use strict;
use warnings;
use HTML::Parser ();
use HTML::Entities qw(encode_entities);
sub disable_tags_but {
my ($text, $allowed_tags) = @_;
my @text;
my %allowed_tag = map { $_ => 1 } @{$allowed_tags || []};
my $tag_h = sub {
my ($tag, $text) = @_;
$text = encode_entities($text, "<") unless $allowed_tag{$tag};
push(@text, $text);
};
HTML::Parser->new(
start_h => [$tag_h, 'tagname, text'],
end_h => [$tag_h, 'tagname, text'],
default_h => [\@text, '@{text}'],
)->parse($text)->eof;
return join("", @text);
}
#
# Test it
#
print disable_tags_but(<<EOT, [qw(a br)]) unless caller;
Test
<foo> <a href="...">...</a>
</bar>
EOT
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| hanchors | File | 1.17 KB | 0755 |
|
| hbody | File | 729 B | 0755 |
|
| hdisable | File | 740 B | 0755 |
|
| hdump | File | 708 B | 0755 |
|
| hform | File | 2.44 KB | 0755 |
|
| hlc | File | 717 B | 0755 |
|
| hrefsub | File | 3 KB | 0755 |
|
| hstrip | File | 1.73 KB | 0755 |
|
| htext | File | 612 B | 0755 |
|
| htextsub | File | 936 B | 0755 |
|
| htitle | File | 461 B | 0755 |
|