From: Andy Grundman Date: Sat, 9 Dec 2006 03:19:33 +0000 (+0000) Subject: Static::Simple 0.15, fixed issue where dirs config option did not quote metachars X-Git-Tag: v0.17~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Static-Simple.git;a=commitdiff_plain;h=9d557523c282d8ada38cc70a35cd742ae7ec2f9e Static::Simple 0.15, fixed issue where dirs config option did not quote metachars --- diff --git a/Changes b/Changes index 775ee01..2ef6397 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Perl extension Catalyst::Plugin::Static::Simple -0.15 +0.15 2006-12-08 22:30:00 + - Quote metacharacters used in $c->config->{dirs} (Vlad Dan Dascalescu) - store Mime::Types object in config hash instead of as classdata - cleanup code a bit diff --git a/META.yml b/META.yml index 9cdc21f..ae6aefa 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Catalyst-Plugin-Static-Simple -version: 0.14 +version: 0.15 author: - Andy Grundman, abstract: Make serving static pages painless. diff --git a/lib/Catalyst/Plugin/Static/Simple.pm b/lib/Catalyst/Plugin/Static/Simple.pm index 76e8f28..a36ecb8 100644 --- a/lib/Catalyst/Plugin/Static/Simple.pm +++ b/lib/Catalyst/Plugin/Static/Simple.pm @@ -21,7 +21,8 @@ sub prepare_action { # is the URI in a static-defined path? foreach my $dir ( @{ $config->{dirs} } ) { - my $re = ( $dir =~ m{^qr/}xms ) ? eval $dir : qr/^${dir}/; + my $dir_re = quotemeta $dir; + my $re = ( $dir =~ m{^qr/}xms ) ? eval $dir : qr/^${dir_re}/; if ($@) { $c->error( "Error compiling static dir regex '$dir': $@" ); }