Skip to:
Content

bbPress.org

Ticket #3206: 3206.patch

File 3206.patch, 1.8 KB (added by wpdennis, 7 years ago)
  • trunk/src/includes/topics/template.php

     
    38533853                } elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) {
    38543854
    38553855                        // 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() );
    38573858
    3858                         // Post author is not the current user
    3859                         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 user
    3863                         } else {
    3864                                 $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() );
    3865                         }
    3866 
    38673859                // Get current status
    38683860                } elseif ( bbp_is_single_topic() ) {
    38693861                        $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() );
  • trunk/src/includes/users/engagements.php

     
    137137 */
    138138function bbp_is_object_of_user( $object_id = 0, $user_id = 0, $rel_key = '', $rel_type = 'post' ) {
    139139        $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 ) );
    141141
    142142        // Filter & return
    143143        return (bool) apply_filters( 'bbp_is_object_of_user', $retval, $object_id, $user_id, $rel_key, $rel_type );