--- versions/blosxom-2.1.2-2020-02-24 2020-03-16 02:26:38.553578000 -0400 +++ blosxom 2020-03-16 02:20:22.386853000 -0400 @@ -2,8 +2,9 @@ # Blosxom # Author: Rael Dornfest (2002-2003), The Blosxom Development Team (2005-2008) -# QZ patch version 2020 Eli the Bearded https://qaz.wtf/qz/ -# Version: 2.1.2QZ +# QZ patch version 2020 Eli the Bearded +# https://qaz.wtf/qz/ and https://github.com/eli-the-bearded/qaz-blog/ +# Version: 2.1.2QZ-20200315 # Home/Docs/Licensing: http://blosxom.sourceforge.net/ # Development/Downloads: http://sourceforge.net/projects/blosxom @@ -97,7 +98,7 @@ use Time::Local; use CGI qw/:standard :netscape/; -$version = "2.1.2"; +$version = "2.1.2QZ-20200315"; # Load configuration from $ENV{BLOSXOM_CONFIG_DIR}/blosxom.conf, if it exists my $blosxom_config; @@ -201,7 +202,8 @@ } else { $static_or_dynamic = 'dynamic'; - param( -name => '-quiet', -value => 1 ); + # ETB: does this next line do anything useful? + #param( -name => '-quiet', -value => 1 ); } # Path Info Magic @@ -455,6 +457,30 @@ } } +# ETB: Get &$interpolate() defined early, previously it was in generate() +# and not available for filter()s to use +# +# Define default interpolation subroutine +$interpolate = sub { + package blosxom; + my $template = shift; + # Interpolate scalars, namespaced scalars, and hash/hashref scalars + $template =~ s/(\$\w+(?:::\w+)*(?:(?:->)?{(['"]?)[-\w]+\2})?)/"defined $1 ? $1 : ''"/gee; + return $template; +}; + +# Plugins: Interpolate +# Allow for the first encountered plugin::interpolate subroutine to +# override the default built-in interpolate subroutine +foreach my $plugin (@plugins) { + if ( $plugins{$plugin} > 0 and $plugin->can('interpolate') ) { + if ( my $tmp = $plugin->interpolate() ) { + $interpolate = $tmp; + last; + } + } +} + my ( $files, $indexes, $others ) = &$entries(); %indexes = %$indexes; @@ -562,29 +588,8 @@ } } - # Define default interpolation subroutine - $interpolate = sub { - package blosxom; - my $template = shift; - # Interpolate scalars, namespaced scalars, and hash/hashref scalars - $template =~ s/(\$\w+(?:::\w+)*(?:(?:->)?{(['"]?)[-\w]+\2})?)/"defined $1 ? $1 : ''"/gee; - return $template; - }; - unless ( defined($skip) and $skip ) { - # Plugins: Interpolate - # Allow for the first encountered plugin::interpolate subroutine to - # override the default built-in interpolate subroutine - foreach my $plugin (@plugins) { - if ( $plugins{$plugin} > 0 and $plugin->can('interpolate') ) { - if ( my $tmp = $plugin->interpolate() ) { - $interpolate = $tmp; - last; - } - } - } - # Head my $head = ( &$template( $currentdir, 'head', $flavour ) ); @@ -694,6 +699,10 @@ chomp( $body = join '', <$fh> ); $fh->close; $raw = "$title\n$body"; + } else { + # ETB: no story? move on (fixes double-print of last story + # sometimes bug) + next; } my $story = ( &$template( $path, 'story', $flavour ) );