mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 07:35:39 +01:00
Escape the output in wp_ajax_upload_attachment()
.
Props whyisjake, sstoqnov. Built from https://develop.svn.wordpress.org/trunk@45936 git-svn-id: http://core.svn.wordpress.org/trunk@45747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
50d33282c1
commit
761cd81a01
@ -22,7 +22,7 @@ if ( defined( 'ABSPATH' ) ) {
|
|||||||
|
|
||||||
require_once( ABSPATH . 'wp-admin/admin.php' );
|
require_once( ABSPATH . 'wp-admin/admin.php' );
|
||||||
|
|
||||||
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
|
||||||
|
|
||||||
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
|
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
|
||||||
include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||||
|
@ -2508,7 +2508,7 @@ function wp_ajax_upload_attachment() {
|
|||||||
'success' => false,
|
'success' => false,
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'message' => __( 'Sorry, you are not allowed to upload files.' ),
|
'message' => __( 'Sorry, you are not allowed to upload files.' ),
|
||||||
'filename' => $_FILES['async-upload']['name'],
|
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -2525,7 +2525,7 @@ function wp_ajax_upload_attachment() {
|
|||||||
'success' => false,
|
'success' => false,
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'message' => __( 'Sorry, you are not allowed to attach files to this post.' ),
|
'message' => __( 'Sorry, you are not allowed to attach files to this post.' ),
|
||||||
'filename' => $_FILES['async-upload']['name'],
|
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -2552,7 +2552,7 @@ function wp_ajax_upload_attachment() {
|
|||||||
'success' => false,
|
'success' => false,
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
|
'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
|
||||||
'filename' => $_FILES['async-upload']['name'],
|
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -2569,7 +2569,7 @@ function wp_ajax_upload_attachment() {
|
|||||||
'success' => false,
|
'success' => false,
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'message' => $attachment_id->get_error_message(),
|
'message' => $attachment_id->get_error_message(),
|
||||||
'filename' => $_FILES['async-upload']['name'],
|
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-alpha-45935';
|
$wp_version = '5.3-alpha-45936';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user