Skip to:
Content
Pages
Categories
Search
Top
Bottom

The way of fixing ”Mention this user”

  • Avatar of chestnut_jp
    chestnut_jp
    Member

    @chestnut_jp

    I have found another problem.
    Because BP 1.2.6 changes bp_get_send_public_message_link(), clicking the “Mention this user” link in the plugin, ex: @chestnut_jp, doesn’t work properly.

    Looking into line 927 of the “bp-activity-templatetags.php” in /plubins/buddypress/bp-activity/, and change as following:
    `[Original]
    return apply_filters( ‘bp_get_send_public_message_link’, wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . ‘/?r=’ . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );

    [Changed]
    return apply_filters( ‘bp_get_send_public_message_link’, $bp->loggedin_user->domain . $bp->activity->slug . ‘/?r=’ . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) );
    `
    Obviously, just delete “wp_nonceurl()”, which is the same as in BP 1.2.5.2.

    However, it might produce security risk.
    Thus, I have no choice but to change as following, which is somewhat weird though:

    At line of 101 in cd-avatar-bubble.php
    `[Original]
    $mention .= ‘@’. bp_core_get_username( $ID, false, false ) .’‘;

    [Changed]
    $mention .= ‘@’. bp_core_get_username( $ID, false, false ) .’‘;
    `

    As a result, the url contains “r=” twice, though it is now working.

    Does anyone have an idea to fix this problem more naturally?

    P.S.:
    Due to the same kind of reason, the plugin’s Private Message link doesn’t work.
    At this moment, I changed like “Mention this user” link as following:
    `
    [Original]
    $message = ‘‘. __( ‘Private Message’, ‘cd_ab’ ) .’‘;

    [Changed]
    $message = ‘‘. __( ‘Private Message’, ‘cd_ab’ ) .’‘;
    `

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.