houseabsolute / HTML-Mason

High-performance, dynamic web site authoring system
https://metacpan.org/release/HTML-Mason/
Other
9 stars 18 forks source link

apply_escapes doesn't complain if you pass in no flags #11

Open autarch opened 4 years ago

autarch commented 4 years ago

Migrated from rt.cpan.org #67972 (status was 'new')

Requestors:

From rt.cpan@sartak.org on 2011-05-05 17:58:43 :

sub apply_escapes { my $self = shift; my $text = shift;

foreach my $flag (@_)
{  
    param_error "Invalid escape flag: $flag"
        unless exists $self->{escapes}{$flag};

    $self->{escapes}{$flag}->(\$text);
}

return $text;

}

It'd be nice if Mason generated a warning or error if @_ == 0, because there seems to be a strong expectation that you don't need any flag to get HTML escaping or something.

Shawn