Ignore:
Timestamp:
Dec 14, 2004, 1:32:21 PM (17 years ago)
Author:
kake
Message:

Fix bug with diff display on nodes containing macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Utils.pm

    r583 r584  
    120120        qr/\@INDEX_LINK\s+\[\[(Category|Locale)\s+([^\]|]+)\|?([^\]]+)?\]\]/ =>
    121121            sub {
    122                   my $wiki = shift;
     122                  # We may be being called by CGI::Wiki::Plugin::Diff,
     123                  # which doesn't know it has to pass us $wiki - and
     124                  # we don't use it anyway.
     125                  if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) {
     126                      shift; # just throw it away
     127                  }
    123128                  my $link_title = $_[2] || "View all pages in $_[0] $_[1]";
    124129                  return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>);
     
    127132             sub {
    128133                   my ($wiki, $type, $value) = @_;
     134
     135                   # We may be being called by CGI::Wiki::Plugin::Diff,
     136                   # which doesn't know it has to pass us $wiki
     137                   unless ( UNIVERSAL::isa( $wiki, "CGI::Wiki" ) ) {
     138                       return "(unprocessed INDEX_LIST macro)";
     139                   }
     140
    129141                   my @nodes = sort $wiki->list_nodes_by_metadata(
    130142                       metadata_type  => $type,
     
    148160                 },
    149161        qr/\@RSS\s+(.+)/ => sub {
    150                     my ($wiki, $url) = @_;
     162                    # We may be being called by CGI::Wiki::Plugin::Diff,
     163                    # which doesn't know it has to pass us $wiki - and
     164                    # we don't use it anyway.
     165                    if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) {
     166                        shift; # just throw it away
     167                    }
     168
     169                    my $url = shift;
    151170
    152171                    # The URL will already have been processed as an inline
Note: See TracChangeset for help on using the changeset viewer.