Changeset 7365

Show
Ignore:
Timestamp:
03/02/08 12:02:08 (5 years ago)
Author:
nyarla
Message:

lang/perl/blosxom/blosxom.nyarla.cgi: warningが出るのを修正

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/blosxom/blosxom.nyarla.cgi

    r7321 r7365  
    139139    my ( $path, $chunk, $flavour ) = @_; 
    140140    my $dir = $flavour_dir || $datadir; 
     141    $path ||= q{}; 
    141142    do { 
    142143        if ( $fh->open("${dir}/${path}/${chunk}.${flavour}", '<') ) { 
     
    153154    } 
    154155    elsif ( defined $template{'error'}{$chunk} ) { 
    155         return $template{error}{$chunk}  
     156        return $template{'error'}{$chunk}  
    156157    } 
    157158    else { 
     
    217218            $files{$name} = $mtime; 
    218219 
    219             my $check = "${static_dir}/${path}/index.$static_flavours[0]"; 
    220             if ( param('-all') || ! -f $check || stat($check)->mtime < $mtime ) { 
    221                 $indexes{$path} = 1; 
    222                 my $dir = join q{/}, (nice_date($mtime))[5,2,3]; 
    223                 $indexes{$dir} = $dir; 
    224                 $indexes{( $path ? '${path}/' : '' )."${fn}.${file_extension}"} = 1 
    225                     if ( $static_entries ); 
     220            if ( $static_dir && $static_flavours[0] ) { 
     221                my $check = "${static_dir}/${path}/index.$static_flavours[0]"; 
     222                if ( param('-all') || ! -f $check || stat($check)->mtime < $mtime ) { 
     223                    $indexes{$path} = 1; 
     224                    my $dir = join q{/}, (nice_date($mtime))[5,2,3]; 
     225                    $indexes{$dir} = $dir; 
     226                    $indexes{( $path ? '${path}/' : '' )."${fn}.${file_extension}"} = 1 
     227                        if ( $static_entries ); 
     228                } 
    226229            } 
    227230 
     
    365368                = ( $path_file =~ m{^$datadir/(?:(.*)/)?(.*)\.$file_extension} ); 
    366369            # Only stories in the right hierarchy 
    367             if ( $path !~ m{^$currentdir} && $path_file ne "${datadir}/${currentdir}" ) { 
     370            if ( ( $path && $path !~ m{^$currentdir} ) && $path_file ne "${datadir}/${currentdir}" ) { 
    368371                next; 
    369372            }