- qw! $version $blog_title $blog_description $blog_language $blog_encoding $datadir $url %template $template $depth $num_entries $file_extension $default_flavour $static_or_dynamic $config_dir $plugin_list $plugin_path $plugin_dir $plugin_state_dir @plugins %plugins $static_dir $static_password @static_flavours $static_entries $path_info $path_info_yr $path_info_mo $path_info_da $path_info_mo_num $flavour $static_or_dynamic %month2num @num2month $interpolate $entries $output $header $show_future_entries %files %indexes %others !;
+ qw! $version $blog_title $blog_description $blog_language $blog_encoding $datadir $url %template $template $depth $num_entries $file_extension $default_flavour $static_or_dynamic $config_dir $plugin_list $plugin_path $plugin_dir $plugin_state_dir @plugins %plugins $static_dir $static_password @static_flavours $static_entries $path_info $path_info_yr $path_info_mo $path_info_da $path_info_mo_num $flavour $static_or_dynamic %month2num @num2month $interpolate $entries $output $header $show_future_entries %files %indexes %others $encode_xml_entities !;
# Load configuration from $ENV{BLOSXOM_CONFIG_DIR}/blosxom.conf, if it exists
my $blosxom_config;
if ( $ENV{BLOSXOM_CONFIG_FILE} && -r $ENV{BLOSXOM_CONFIG_FILE} ) {
# Load configuration from $ENV{BLOSXOM_CONFIG_DIR}/blosxom.conf, if it exists
my $blosxom_config;
if ( $ENV{BLOSXOM_CONFIG_FILE} && -r $ENV{BLOSXOM_CONFIG_FILE} ) {
-if ( $plugin_list and -r $plugin_list and $fh->open("< $plugin_list") ) {
- @plugin_list = map { chomp $_; $_ } grep { /\S/ && !/^#/ } <$fh>;
- $fh->close;
+if ( $plugin_list ) {
+ if ( -r $plugin_list and $fh->open("< $plugin_list") ) {
+ @plugin_list = map { chomp $_; $_ } grep { /\S/ && !/^#/ } <$fh>;
+ $fh->close;
+ }
+ else {
+ warn "unable to read or open plugin_list '$plugin_list': $!";
+ $plugin_list = '';
+ }
for my $plugin_dir (@plugin_dirs) {
next unless -d $plugin_dir;
if ( opendir PLUGINS, $plugin_dir ) {
for my $plugin_dir (@plugin_dirs) {
next unless -d $plugin_dir;
if ( opendir PLUGINS, $plugin_dir ) {
unshift @INC, @plugin_dirs;
foreach my $plugin (@plugin_list) {
my ( $plugin_name, $off ) = $plugin =~ /^\d*([\w:]+?)(_?)$/;
unshift @INC, @plugin_dirs;
foreach my $plugin (@plugin_list) {
my ( $plugin_name, $off ) = $plugin =~ /^\d*([\w:]+?)(_?)$/;
- if ( $plugin =~ m/::/ && -z $plugin_hash{$plugin} ) {
+ # The -z test is a hack to allow a zero-length placeholder file in a
+ # $plugin_path directory to indicate an @INC module should be loaded
+ if ( $plugin =~ m/::/ && ( $plugin_list || -z $plugin_hash{$plugin} ) ) {
- $template =~ s/(\$\w+(?:::\w+)*)/"defined $1 ? $1 : ''"/gee;
+ # Interpolate scalars, namespaced scalars, and hash/hashref scalars
+ $template =~ s/(\$\w+(?:::\w+)*(?:(?:->)?{(['"]?)[-\w]+\2})?)/"defined $1 ? $1 : ''"/gee;
# Escape <, >, and &, and to produce valid RSS
my %escape = (
# Escape <, >, and &, and to produce valid RSS
my %escape = (
- my ( $dw, $mo, $da, $hr, $min, $yr )
+ my ( $dw, $mo, $da, $hr, $min, $sec, $yr )
);
$ti = "$hr:$min";
$da = sprintf( "%02d", $da );
my $mo_num = $month2num{$mo};
my $offset
);
$ti = "$hr:$min";
$da = sprintf( "%02d", $da );
my $mo_num = $month2num{$mo};
my $offset
- = timegm( 00, $min, $hr, $da, $mo_num - 1, $yr - 1900 ) - $unixtime;
+ = timegm( $sec, $min, $hr, $da, $mo_num - 1, $yr - 1900 ) - $unixtime;
my $utc_offset = sprintf( "%+03d", int( $offset / 3600 ) )
. sprintf( "%02d", ( $offset % 3600 ) / 60 );
my $utc_offset = sprintf( "%+03d", int( $offset / 3600 ) )
. sprintf( "%02d", ( $offset % 3600 ) / 60 );