Skip to:
Content

BuddyPress.org

Changeset 12257


Ignore:
Timestamp:
10/20/2018 02:53:54 PM (6 years ago)
Author:
boonebgorges
Message:

bp-legacy: Disable cookie-based filter "preferences" for activity directory when logged out.

Extends the changes in [12255] to the activity directory, which uses
a different technique for directory filter template requests.

See #7856.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r12256 r12257  
    19031903/* Activity Loop Requesting */
    19041904function bp_activity_request(scope, filter) {
    1905     /* Save the type and filter to a session cookie */
    1906     if ( null !== scope ) {
    1907         jq.cookie( 'bp-activity-scope', scope, {
    1908             path: '/',
    1909             secure: ( 'https:' === window.location.protocol )
    1910         } );
    1911     }
    1912     if ( null !== filter ) {
    1913         jq.cookie( 'bp-activity-filter', filter, {
    1914             path: '/',
    1915             secure: ( 'https:' === window.location.protocol )
    1916         } );
    1917     }
     1905    /* Save the type and filter */
     1906    bp_set_directory_preference( 'activity', 'scope', scope );
     1907    bp_set_directory_preference( 'activity', 'filter', filter );
    19181908
    19191909    /* Remove selected and loading classes from tabs */
     
    19331923    }
    19341924
     1925    // Get directory preferences (called "cookie" for legacy reasons).
     1926    var cookies = {
     1927        'bp-activity-filter': bp_get_directory_preference( 'activity', 'filter' ),
     1928        'bp-activity-scope': bp_get_directory_preference( 'activity', 'scope' )
     1929    };
     1930
     1931    var cookie = encodeURIComponent( jq.param( cookies ) );
     1932
    19351933    bp_ajax_request = jq.post( ajaxurl, {
    19361934        action: 'activity_widget_filter',
    1937         'cookie': bp_get_cookies(),
     1935        'cookie': cookie,
    19381936        '_wpnonce_activity_filter': jq('#_wpnonce_activity_filter').val(),
    19391937        'scope': scope,
Note: See TracChangeset for help on using the changeset viewer.