From: Marius Gavrilescu Date: Sat, 17 Aug 2013 21:09:54 +0000 (+0300) Subject: Use the escaping in HTML::Template::Compiled X-Git-Tag: 0.002~8 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e0fa307063761968a2fe530c5f27e002aa8bdd8c;p=app-musicexpo.git Use the escaping in HTML::Template::Compiled --- diff --git a/Makefile.PL b/Makefile.PL index 2748617..4126026 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,11 +6,9 @@ WriteMakefile( VERSION => '0.001001', PREREQ_PM => { 'Audio::FLAC::Header' => 0, - 'HTML::Entities' => 0, 'HTML::Template::Compiled' => 0, 'Memoize' => 0, 'MP3::Tag' => 0, - 'URI::Escape' => 0, 'DB_File' => 0, }, MIN_PERL_VERSION => 5.014, diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 3194665..475ef80 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -4,11 +4,9 @@ use strict; use warnings; use Audio::FLAC::Header qw//; -use HTML::Entities qw/encode_entities/; use HTML::Template::Compiled qw//; use Memoize qw/memoize/; use MP3::Tag qw//; -use URI::Escape qw/uri_escape/; use DB_File qw//; use File::Basename qw/fileparse/; @@ -35,13 +33,12 @@ GetOptions ( sub fix{ utf8::decode($_[0]); - encode_entities($_[0]) } sub flacinfo{ my $file=$_[0]; my $flac=Audio::FLAC::Header->new($file); - $file = $prefix . uri_escape scalar fileparse $file; + $file = $prefix . scalar fileparse $file; freeze +{ format => 'FLAC', @@ -59,7 +56,7 @@ sub flacinfo{ sub mp3info{ my $file=$_[0]; my $mp3=MP3::Tag->new($file); - $file = $prefix . uri_escape scalar fileparse $file; + $file = $prefix . scalar fileparse $file; freeze +{ format => 'MP3', @@ -89,7 +86,10 @@ sub run { push @files, thaw mp3info $file if $file =~ /.mp3$/i; } - my $ht=HTML::Template::Compiled->new( $template eq '' ? (scalarref => \$default_template) : (filename => $template)); + my $ht=HTML::Template::Compiled->new( + default_escape => 'HTML', + $template eq '' ? (scalarref => \$default_template) : (filename => $template), + ); $ht->param(files=>[sort { $a->{title} cmp $b->{title} } @files]); print $ht->output; } @@ -104,7 +104,7 @@ $default_template = <<'HTML'; TitleArtistAlbumGenreTrackYearType -/ +/ HTML