mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
In wp_ajax_upload_attachment(), wp_check_filetype_and_ext() doesn't need a 3rd param - it already defaults to null. Passing false would fail a strict check
See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31119 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1858,7 +1858,7 @@ function wp_ajax_upload_attachment() {
|
||||
|
||||
// If the context is custom header or background, make sure the uploaded file is an image.
|
||||
if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) {
|
||||
$wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'], false );
|
||||
$wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'] );
|
||||
if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
|
||||
wp_send_json_error( array(
|
||||
'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
|
||||
|
||||
Reference in New Issue
Block a user