Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bp-forums/classes/class-bp-rest-reply-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ public function update_item_permissions_check( $request ) {
if ( is_user_logged_in() || bbp_allow_anonymous() ) {
$retval = $this->get_item_permissions_check( $request );
$reply = bbp_get_reply( $request->get_param( 'id' ) );
if ( bbp_get_user_id( 0, true, true ) !== $reply->post_author && ! current_user_can( 'edit_reply', $request['id'] ) ) {
if ( true === $retval && bbp_get_user_id( 0, true, true ) !== $reply->post_author && ! current_user_can( 'edit_reply', $request['id'] ) ) {
$retval = new WP_Error(
'bp_rest_authorization_required',
__( 'Sorry, you are not allowed to update this reply.', 'buddyboss' ),
Expand Down
2 changes: 1 addition & 1 deletion src/bp-forums/classes/class-bp-rest-topics-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function get_items( $request ) {
$default['perm'] = 'readable';
}

$tag = sanitize_title( $request->get_param( 'tag' ) );
$tag = sanitize_title( $request->get_param( 'tag' ) ?? '' );

if ( bbp_allow_topic_tags() && ! empty( $tag ) ) {
$default['term'] = bbp_get_topic_tag_slug( $tag );
Expand Down
2 changes: 1 addition & 1 deletion src/bp-forums/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ function bbp_forum_recursive_group_id( $forum_id ) {
$group_id = $forum_group_ids[0];
} else {
$current_post = get_post( $forum_id );
if ( $current_post->post_parent ) {
if ( $current_post && $current_post->post_parent ) {
// $post->post_parent will be the ID of the parent, not an object.
$forum_id = $current_post->post_parent;
} else {
Expand Down
Loading