mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-21 03:51:26 +02:00
Escape the output in wp_ajax_upload_attachment()
.
Merges [45936] to the 3.9 branch. Props whyisjake, sstoqnov. Built from https://develop.svn.wordpress.org/branches/3.9@45966 git-svn-id: http://core.svn.wordpress.org/branches/3.9@45777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2dd32a25ce
commit
e1a05244d9
@ -32,7 +32,7 @@ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
|
||||
/** Load Ajax Handlers for WordPress Core */
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
|
||||
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
||||
@header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
|
||||
@header( 'X-Robots-Tag: noindex' );
|
||||
|
||||
send_nosniff_header();
|
||||
|
@ -1620,7 +1620,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@ -1635,7 +1635,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => $attachment_id->get_error_message(),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user