Changeset 440

Show
Ignore:
Timestamp:
07/13/04 23:55:53 (4 years ago)
Author:
kake
Message:

Fixed HTML escaping bug, added test.

Location:
trunk
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r439 r440  
    1 0.36 
    2         Changed node template to include link to diff of current version 
    3           from previous version.  
    4         Fixed case sensitivity bug in index node autocreation. 
     10.36    13 July 2004 
     2        Added diff link to node template. Fixed case sensitivity bug in 
     3          index node autocreation.  Fixed bug with node history comments 
     4          not being HTML-escaped. 
    55 
    660.35    25 June 2004 
  • trunk/MANIFEST

    r401 r440  
    6565t/62_bug_os_coords.t 
    6666t/63_bug_map_link_no_address.t 
     67t/64_bug_node_history.t 
    6768t/templates/15_test.tt 
    6869wiki.cgi 
  • trunk/lib/OpenGuides.pm

    r431 r440  
    1313use vars qw( $VERSION ); 
    1414 
    15 $VERSION = '0.35'; 
     15$VERSION = '0.36'; 
    1616 
    1717=head1 NAME 
     
    432432  $guide->list_all_versions ( id => "Home Page" ); 
    433433 
     434  # Or return output as a string (useful for writing tests). 
     435  $guide->list_all_versions ( 
     436                              id            => "Home Page", 
     437                              return_output => 1, 
     438                            ); 
     439 
     440  # Or return the hash of variables that will be passed to the template 
     441  # (not including those set additionally by OpenGuides::Template). 
     442  $guide->list_all_versions ( 
     443                              id             => "Home Page", 
     444                              return_tt_vars => 1, 
     445                            ); 
     446 
    434447=cut 
    435448 
    436449sub list_all_versions { 
    437450    my ($self, %args) = @_; 
     451    my $return_output = $args{return_output} || 0; 
    438452    my $node = $args{id}; 
    439453    my %curr_data = $self->wiki->retrieve_node($node); 
     
    445459                                                    version => $version ); 
    446460        # $node_data{version} will be zero if this version was deleted. 
    447         push @history, { version  => $version, 
    448                          modified => $node_data{last_modified}, 
    449                          username => $node_data{metadata}{username}[0], 
    450                          comment  => $node_data{metadata}{comment}[0], 
     461        push @history, { 
     462            version  => CGI->escapeHTML( $version ), 
     463            modified => CGI->escapeHTML( $node_data{last_modified} ), 
     464            username => CGI->escapeHTML( $node_data{metadata}{username}[0] ), 
     465            comment  => CGI->escapeHTML( $node_data{metadata}{comment}[0] ), 
    451466                       } if $node_data{version}; 
    452467    } 
     
    456471                    not_deletable => 1, 
    457472                    history       => \@history ); 
    458     print $self->process_template( 
    459                                    id       => $node, 
    460                                    template => "node_history.tt", 
    461                                    tt_vars  => \%tt_vars, 
    462                                  ); 
     473    return %tt_vars if $args{return_tt_vars}; 
     474    my $output = $self->process_template( 
     475                                          id       => $node, 
     476                                          template => "node_history.tt", 
     477                                          tt_vars  => \%tt_vars, 
     478                                        ); 
     479    return $output if $return_output; 
     480    print $output; 
    463481} 
    464482 
  • trunk/wiki.cgi

    r437 r440  
    55 
    66use vars qw( $VERSION ); 
    7 $VERSION = '0.35'; 
     7$VERSION = '0.36'; 
    88 
    99use CGI qw/:standard/;