Skip to content
Permalink
Browse files

WP-r45943: Escape the output in `wp_ajax_upload_attachment()`.

Merges https://core.trac.wordpress.org/changeset/45936 to the 4.9 branch.
WP:Props whyisjake, sstoqnov.

----
Merges https://core.trac.wordpress.org/changeset/45943 / WordPress/wordpress-develop@88ae167 to ClassicPress.
  • Loading branch information...
SergeyBiryukov authored and nylen committed Sep 5, 2019
1 parent ecfea53 commit 1c174bca5882b861dc64bb9ae9e8fb07ed2507f1
Showing with 5 additions and 5 deletions.
  1. +1 −1 src/wp-admin/async-upload.php
  2. +4 −4 src/wp-admin/includes/ajax-actions.php
@@ -22,7 +22,7 @@
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'] ) {
include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
@@ -2023,7 +2023,7 @@ function wp_ajax_upload_attachment() {
'success' => false,
'data' => array(
'message' => __( 'Sorry, you are not allowed to upload files.' ),
'filename' => $_FILES['async-upload']['name'],
'filename' => esc_html( $_FILES['async-upload']['name'] ),
)
) );
@@ -2037,7 +2037,7 @@ function wp_ajax_upload_attachment() {
'success' => false,
'data' => array(
'message' => __( 'Sorry, you are not allowed to attach files to this post.' ),
'filename' => $_FILES['async-upload']['name'],
'filename' => esc_html( $_FILES['async-upload']['name'] ),
)
) );
@@ -2061,7 +2061,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'] ),
)
) );
@@ -2076,7 +2076,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'] ),
)
) );

0 comments on commit 1c174bc

Please sign in to comment.
You can’t perform that action at this time.