Ignore:
Timestamp:
Jun 13, 2005, 1:37:56 AM (16 years ago)
Author:
Dominic Hargreaves
Message:

Fix redirection loops, RT #13205

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r647 r648  
    171171        $redirect =~ s/\]\]\s*$//;
    172172        # See if this is a valid node, if not then just show the page as-is.
    173         if ( $wiki->node_exists($redirect) ) {
     173        # Avoid loops by not generating redirects to the same node or the
     174        # previous node.
     175    if ( $wiki->node_exists($redirect) && $redirect != $id && $redirect != $oldid ) {
    174176            my $output = $self->redirect_to_node($redirect, $id);
    175177            return $output if $return_output;
    176178            print $output;
    177179            exit 0;
    178         }
     180    }
    179181    }
    180182    my $content    = $wiki->format($raw);
Note: See TracChangeset for help on using the changeset viewer.