Skip to:
Content

Changeset 2124


Ignore:
Timestamp:
11/25/09 12:34:55 (4 years ago)
Author:
johnjamesjacoby
Message:

Fixes #1184

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bp-core/bp-core-avatars.php

    r2118 r2124  
    222222 
    223223    $uploadErrors = array( 
    224         0 => __("There is no error, the file uploaded with success", 'buddypress'), 
    225         1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE), 
    226         2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE), 
    227         3 => __("The uploaded file was only partially uploaded", 'buddypress'), 
    228         4 => __("No file was uploaded", 'buddypress'), 
    229         6 => __("Missing a temporary folder", 'buddypress') 
     224        0 => __("There is no error, the file uploaded with success", 'buddypress'), 
     225        1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE), 
     226        2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE), 
     227        3 => __("The uploaded file was only partially uploaded", 'buddypress'), 
     228        4 => __("No file was uploaded", 'buddypress'), 
     229        6 => __("Missing a temporary folder", 'buddypress') 
    230230    ); 
    231231 
     
    269269        $bp->avatar_admin->image->dir = $bp->avatar_admin->resized; 
    270270        @unlink( $bp->avatar_admin->original['file'] ); 
     271    } 
     272 
     273    /* Check for WP_Error on what should be an image */ 
     274    if ( is_wp_error( $bp->avatar_admin->image->dir ) ) { 
     275        bp_core_add_message( sprintf( __( 'Upload failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->image->dir->get_error_message() ), 'error' ); 
     276        return false; 
    271277    } 
    272278 
Note: See TracChangeset for help on using the changeset viewer.