Ticket #3206: 3206.patch
File 3206.patch, 1.8 KB (added by , 7 years ago) |
---|
-
trunk/src/includes/topics/template.php
3853 3853 } elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) { 3854 3854 3855 3855 // Get current posts author 3856 $post_author = bbp_get_global_post_field( 'post_author', 'raw' ); 3856 $post_author = (int) bbp_get_global_post_field( 'post_author', 'raw' ); 3857 $topic_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_topic_id() ); 3857 3858 3858 // Post author is not the current user3859 if ( bbp_get_current_user_id() !== $post_author ) {3860 $topic_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_topic_id() );3861 3862 // Post author is the current user3863 } else {3864 $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() );3865 }3866 3867 3859 // Get current status 3868 3860 } elseif ( bbp_is_single_topic() ) { 3869 3861 $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() ); -
trunk/src/includes/users/engagements.php
137 137 */ 138 138 function bbp_is_object_of_user( $object_id = 0, $user_id = 0, $rel_key = '', $rel_type = 'post' ) { 139 139 $user_ids = bbp_get_users_for_object( $object_id, $rel_key, $rel_type ); 140 $retval = is_numeric( array_search( $user_id, $user_ids, true ) );140 $retval = is_numeric( array_search( (int) $user_id, $user_ids, true ) ); 141 141 142 142 // Filter & return 143 143 return (bool) apply_filters( 'bbp_is_object_of_user', $retval, $object_id, $user_id, $rel_key, $rel_type );