Well, this is irritating.

This commit is contained in:
Chris 2013-05-22 14:50:39 +01:00
parent c82ee9c8bb
commit 4b55e3c692

View File

@ -46,7 +46,7 @@ my $default_allow = [
]; ];
# Explicit rules for allowed tags, required to provide per-tag tweaks to the filter. # Explicit rules for allowed tags, required to provide per-tag tweaks to the filter.
my $default_rules = { my $default_rules = [
img => { img => {
src => qr{^(?:http|https)://}i, src => qr{^(?:http|https)://}i,
alt => 1, alt => 1,
@ -90,10 +90,10 @@ my $default_rules = {
title => 1, title => 1,
'*' => 0, '*' => 0,
}, },
}; ];
# Default ruleset applied when no explicit rule is found for a tag. # Default ruleset applied when no explicit rule is found for a tag.
my $default_default = { my $default_default = [
0 => # default rule, deny all tags 0 => # default rule, deny all tags
{ {
'href' => qr{^(?:http|https)://[-\w]+(?:\.[-\w]+)/}i, # Force basic URL forms 'href' => qr{^(?:http|https)://[-\w]+(?:\.[-\w]+)/}i, # Force basic URL forms
@ -102,7 +102,7 @@ my $default_default = {
'name' => 1, 'name' => 1,
'*' => 0, # default rule, deny all attributes '*' => 0, # default rule, deny all attributes
} }
}; ];
## @fn $ scrub_html($html, $allow, $rules, $default) ## @fn $ scrub_html($html, $allow, $rules, $default)