Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/25/2016 01:23:29 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Moderators: pass current forum/topic/reply ID into moderate capability checks, providing additional context about what's being moderated so more targeted decisions can be made.

See #459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/replies.php

    r5951 r6032  
    716716                    // Alert capable users of reply forum mismatch
    717717                    if ( $reply_forum_id !== $topic_forum_id ) {
    718                         if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {
     718                        if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $reply_id ) ) {
    719719                            $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>';
    720720                        }
     
    851851        }
    852852
    853         // Add Empty Spam button
     853        // Add "Empty Spam" button for moderators
    854854        if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {
    855855            wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    856             $title = esc_attr__( 'Empty Spam', 'bbpress' );
    857             submit_button( $title, 'button-secondary apply', 'delete_all', false );
     856            submit_button(
     857                esc_attr__( 'Empty Spam', 'bbpress' ),
     858                'button-secondary apply',
     859                'delete_all',
     860                false
     861            );
    858862        }
    859863
    860864        // Get which forum is selected
    861         $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : '';
     865        $selected = ! empty( $_GET['bbp_forum_id'] )
     866            ? (int) $_GET['bbp_forum_id']
     867            : 0;
    862868
    863869        // Show the forums dropdown
Note: See TracChangeset for help on using the changeset viewer.