Skip to:
Content

bbPress.org

Changeset 7458


Ignore:
Timestamp:
09/09/2026 03:49:53 AM (12 days ago)
Author:
johnjamesjacoby
Message:

Replies: Prevent replies to unreadable topics.

Backport the relevant parent-topic capability check from [7350] so Participants cannot submit replies to topics they cannot read. Add regression coverage for private topics.

Props hoangkien1020.
See #3650.

Location:
branches/2.6
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/replies/functions.php

    r7451 r7458  
    202202        }
    203203
     204        // User cannot read parent topic ID
     205        if ( ! current_user_can( 'read_topic', $topic_id ) ) {
     206                bbp_add_error( 'bbp_new_reply_topic_public', __( '<strong>Error</strong>: You do not have the capability to read or create new replies in this topic.', 'bbpress' ) );
     207        }
     208
    204209        /** Forum ID **************************************************************/
    205210
Note: See TracChangeset for help on using the changeset viewer.