Changeset 22521 for trunk/wp-admin/includes/ajax-actions.php
- Timestamp:
- 11/10/2012 05:36:37 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r22370 r22521 1610 1610 $post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array(); 1611 1611 1612 // If the context is custom header or background, make sure the uploaded file is an image. 1613 if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) { 1614 $wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'], false ); 1615 if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) { 1616 wp_send_json_error( array( 1617 'message' => __( 'The uploaded file is not a valid image. Please try again.' ), 1618 'filename' => $_FILES['async-upload']['name'], 1619 ) ); 1620 } 1621 } 1622 1612 1623 $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data ); 1613 1624
Note: See TracChangeset
for help on using the changeset viewer.