fix bug 1445435.
[matthijs/upstream/blosxom.git] / blosxom.cgi
index a979a0d29da750919f37b77998171717430dca21..48ee5c1f7668cf7bd136522e887a29d9934f0a2f 100755 (executable)
@@ -363,7 +363,7 @@ sub generate {
       ($path,$fn) = $path_file =~ m!^$datadir/(?:(.*)/)?(.*)\.$file_extension!;
   
       # Only stories in the right hierarchy
       ($path,$fn) = $path_file =~ m!^$datadir/(?:(.*)/)?(.*)\.$file_extension!;
   
       # Only stories in the right hierarchy
-      $path =~ /^$currentdir/ or $path_file eq "$datadir/$currentdir" or next;
+      $path =~ /^$currentdir(?=$|/)/ or $path_file eq "$datadir/$currentdir" or next;
   
       # Prepend a slash for use in templates only if a path exists
       $path &&= "/$path";
   
       # Prepend a slash for use in templates only if a path exists
       $path &&= "/$path";