diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 5a13bcc243..c9d603ea8f 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -499,6 +499,7 @@ function media_upload_image() { $id = 0; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { + check_admin_referer('media-form'); // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); @@ -604,6 +605,7 @@ function media_upload_audio() { $id = 0; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { + check_admin_referer('media-form'); // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); @@ -662,6 +664,7 @@ function media_upload_video() { $id = 0; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { + check_admin_referer('media-form'); // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); @@ -720,6 +723,7 @@ function media_upload_file() { $id = 0; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { + check_admin_referer('media-form'); // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES); diff --git a/wp-admin/media-upload.php b/wp-admin/media-upload.php index 19eda09652..81bbf5369a 100644 --- a/wp-admin/media-upload.php +++ b/wp-admin/media-upload.php @@ -38,6 +38,7 @@ if ( isset($_GET['inline']) ) { $errors = array(); if ( isset($_POST['html-upload']) && !empty($_FILES) ) { + check_admin_referer('media-form'); // Upload File button was clicked $id = media_handle_upload('async-upload', $_REQUEST['post_id']); unset($_FILES);