mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
better handling of comparing a revision to itself. Props mdawaffe. see #6775
git-svn-id: http://svn.automattic.com/wordpress/trunk@8176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88f779c343
commit
4f77631dd4
@ -43,6 +43,12 @@ case 'diff' :
|
||||
if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) )
|
||||
break;
|
||||
|
||||
// If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post
|
||||
if ( $left_revision->ID == $right_revision->ID ) {
|
||||
$redirect = get_edit_post_link( $left_revision->ID );
|
||||
break;
|
||||
}
|
||||
|
||||
// Don't allow reverse diffs?
|
||||
if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) {
|
||||
$redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) );
|
||||
|
Loading…
Reference in New Issue
Block a user