Skip to:
Content

BuddyPress.org

Changeset 6812


Ignore:
Timestamp:
02/22/2013 04:52:36 PM (12 years ago)
Author:
boonebgorges
Message:

Remove avatar location filter after handling avatar uploads

BP filters upload_dir when handling avatar uploads, to ensure that avatar files
are stored in the proper directories. This changeset ensures that the filter is
removed after use, to ensure the integrity of calls to wp_upload_dir() later on
the crop page (after the avatar upload has been handled).

Fixes #4574

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r6707 r6812  
    519519    $bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
    520520
     521    // Remove the upload_dir filter, so that other upload URLs on the page
     522    // don't break
     523    remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
     524
    521525    // Move the file to the correct upload location.
    522526    if ( !empty( $bp->avatar_admin->original['error'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.