Make WordPress Core

Ticket #40577: 40577.diff

File 40577.diff, 812 bytes (added by adamsilverstein, 6 years ago)
  • src/wp-admin/revision.php

    diff --git src/wp-admin/revision.php src/wp-admin/revision.php
    index c86f78a451..35da8ad68e 100644
    default : 
    6363        if ( ! $post = get_post( $revision->post_parent ) )
    6464                break;
    6565
    66         if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) )
     66        if (
     67                (
     68                        ! current_user_can( 'read_post', $revision->ID ) ||
     69                        ! current_user_can( 'edit_post', $revision->post_parent )
     70                ) &&
     71                (
     72                        ! current_user_can( 'read_revision', $revision->ID ) ||
     73                        ! current_user_can( 'read_revisions', $revision->post_parent )
     74                )
     75        ) {
    6776                break;
     77        }
    6878
    6979        // Revisions disabled and we're not looking at an autosave
    7080        if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {