From: Kevin Scaldeferri Date: Sat, 26 Nov 2005 19:41:21 +0000 (+0000) Subject: fixed bug 1356937 X-Git-Tag: v2_0_1~1 X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom.git;a=commitdiff_plain;h=f24c1e459d4ced39f5d529b526aa324a058ef1e7 fixed bug 1356937 This sets the path_info fields correctly when statically rendering date pages. --- diff --git a/blosxom.cgi b/blosxom.cgi index 1233ea4..c53b153 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -237,7 +237,6 @@ if (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and par foreach ( ('', split /\//, $path) ) { $p .= "/$_"; $p =~ s!^/!!; - $path_info = $p; $done{$p}++ and next; (-d "$static_dir/$p" or $p =~ /\.$file_extension$/) or mkdir "$static_dir/$p", 0755; foreach $flavour ( @static_flavours ) { @@ -247,10 +246,17 @@ if (!$ENV{GATEWAY_INTERFACE} and param('-password') and $static_password and par param('-quiet') or print "$fn.$flavour\n"; my $fh_w = new FileHandle "> $static_dir/$fn.$flavour" or die "Couldn't open $static_dir/$p for writing: $!"; $output = ''; - print $fh_w - $indexes{$path} == 1 - ? &generate('static', $p, '', $flavour, $content_type) - : &generate('static', '', $p, $flavour, $content_type); + if ($indexes{$path} == 1) { + # category + $path_info = $p; + print $fh_w &generate('static', $p, '', $flavour, $content_type); + } else { + # date + local ($path_info_yr,$path_info_mo,$path_info_da, $path_info) = + split /\//, $p, 4; + unless (defined $path_info) {$path_info = ""}; + print $fh_w &generate('static', '', $p, $flavour, $content_type); + } $fh_w->close; } }