Make WordPress Core

Changeset 45966


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/3.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

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

    r28126 r45966  
    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.9/src/wp-admin/includes/ajax-actions.php

    r44855 r45966  
    16211621                'data'    => array(
    16221622                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    1623                     'filename' => $_FILES['async-upload']['name'],
     1623                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16241624                )
    16251625            ) );
     
    16361636            'data'    => array(
    16371637                'message'  => $attachment_id->get_error_message(),
    1638                 'filename' => $_FILES['async-upload']['name'],
     1638                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16391639            )
    16401640        ) );
Note: See TracChangeset for help on using the changeset viewer.