Static::Simple 0.15, fixed issue where dirs config option did not quote metachars
Andy Grundman [Sat, 9 Dec 2006 03:19:33 +0000 (03:19 +0000)]
Changes
META.yml
lib/Catalyst/Plugin/Static/Simple.pm

diff --git a/Changes b/Changes
index 775ee01..2ef6397 100644 (file)
--- 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
 
index 9cdc21f..ae6aefa 100644 (file)
--- 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, <andy@hybridized.org>
 abstract: Make serving static pages painless.
index 76e8f28..a36ecb8 100644 (file)
@@ -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': $@" );
         }