Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2009 06:52:51 AM (17 years ago)
Author:
apeatling
Message:

Added nonce security checks to all BuddyPress actions. Fixes #454

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-ajax.php

    r1025 r1032  
    44    global $bp;
    55
    6     check_ajax_referer('friend_search');
     6    check_ajax_referer( 'friends_search' );
    77   
    88    load_template( get_template_directory() . '/friends/friends-loop.php' );
     
    1414
    1515    if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
     16       
     17        check_ajax_referer('friends_remove_friend');
     18       
    1619        if ( !friends_remove_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    1720            echo __("Friendship could not be canceled.", 'buddypress');
    1821        } else {
    19             echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $_POST['fid'] . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
     22            echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
    2023        }
    2124    } else if ( 'not_friends' == BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
     25       
     26        check_ajax_referer('friends_add_friend');
     27       
    2228        if ( !friends_add_friend( $bp->loggedin_user->id, $_POST['fid'] ) ) {
    2329            echo __("Friendship could not be requested.", 'buddypress');
Note: See TracChangeset for help on using the changeset viewer.