WordPress.org

Make WordPress Core

Changeset 8176


Ignore:
Timestamp:
06/23/2008 10:45:19 PM (11 years ago)
Author:
ryan
Message:

better handling of comparing a revision to itself. Props mdawaffe. see #6775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/revision.php

    r8012 r8176  
    4343    if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) )
    4444        break;
     45
     46    // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post
     47    if ( $left_revision->ID == $right_revision->ID ) {
     48        $redirect = get_edit_post_link( $left_revision->ID );
     49        break;
     50    }
    4551
    4652    // Don't allow reverse diffs?
Note: See TracChangeset for help on using the changeset viewer.