Make WordPress Core

Changeset 12142


Ignore:
Timestamp:
11/05/2009 02:24:20 PM (14 years ago)
Author:
ryan
Message:

Bring in wp_handle_upload_prefilter from MU

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/file.php

    r11963 r12142  
    224224    }
    225225
     226    $file = apply_filters( 'wp_handle_upload_prefilter', $file );
     227
    226228    // You may define your own function and pass the name in $overrides['upload_error_handler']
    227229    $upload_error_handler = 'wp_handle_upload_error';
     230
     231    // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file.  Handle that gracefully.
     232    if ( isset( $file['error'] ) && !ctype_digit( $file['error'] ) && $file['error'] )
     233        return $upload_error_handler( $file, $file['error'] );
    228234
    229235    // You may define your own function and pass the name in $overrides['unique_filename_callback']
Note: See TracChangeset for help on using the changeset viewer.