Ticket #6775: 6775.4.diff
File 6775.4.diff, 1.9 KB (added by , 16 years ago) |
---|
-
wp-includes/post-template.php
641 641 642 642 $rows = ''; 643 643 $class = false; 644 $can_edit_post = current_user_can( 'edit_post', $post->ID ); 644 645 foreach ( $revisions as $revision ) { 646 if ( !current_user_can( 'read_post', $revision->ID ) ) 647 continue; 648 645 649 $date = wp_post_revision_title( $revision ); 646 650 $name = get_author_name( $revision->post_author ); 647 651 … … 654 658 655 659 $class = $class ? '' : " class='alternate'"; 656 660 657 if ( $post->ID != $revision->ID && current_user_can( 'edit_post', $post->ID ))661 if ( $post->ID != $revision->ID && $can_edit_post ) 658 662 $actions = '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'diff' => false, 'action' => 'restore' ) ), "restore-post_$post->ID|$revision->ID" ) . '">' . __( 'Restore' ) . '</a>'; 659 663 else 660 664 $actions = ''; -
wp-admin/revision.php
38 38 if ( !$right_revision = get_post( $right ) ) 39 39 break; 40 40 41 if ( !current_user_can( ' edit_post', $left_revision->ID ) || !current_user_can( 'edit_post', $right_revision->ID ) )41 if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) ) 42 42 break; 43 43 44 44 // Don't allow reverse diffs? … … 80 80 if ( !$post = get_post( $revision->post_parent ) ) 81 81 break; 82 82 83 if ( !current_user_can( ' edit_post', $revision->ID ) || !current_user_can( 'edit_post', $post->ID ) )83 if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) ) 84 84 break; 85 85 86 86 $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';