Make WordPress Core

Changeset 45967


Ignore:
Timestamp:
09/04/2019 04:46:37 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Escape the output in wp_ajax_upload_attachment().

Merges [45936] to the 3.8 branch.
Props whyisjake, sstoqnov.

Location:
branches/3.8
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/src/wp-admin/admin-ajax.php

    r26137 r45967  
    3333require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
    3434
    35 @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
     35@header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
    3636@header( 'X-Robots-Tag: noindex' );
    3737
  • branches/3.8/src/wp-admin/includes/ajax-actions.php

    r44856 r45967  
    16721672                'data'    => array(
    16731673                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    1674                     'filename' => $_FILES['async-upload']['name'],
     1674                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16751675                )
    16761676            ) );
     
    16871687            'data'    => array(
    16881688                'message'  => $attachment_id->get_error_message(),
    1689                 'filename' => $_FILES['async-upload']['name'],
     1689                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16901690            )
    16911691        ) );
Note: See TracChangeset for help on using the changeset viewer.