Make WordPress Core

Changeset 45960 for branches/4.0


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/4.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

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

    r29178 r45960  
    3535require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
    3636
    37 @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
     37@header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
    3838@header( 'X-Robots-Tag: noindex' );
    3939
  • branches/4.0/src/wp-admin/includes/ajax-actions.php

    r44854 r45960  
    18521852                'data'    => array(
    18531853                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    1854                     'filename' => $_FILES['async-upload']['name'],
     1854                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    18551855                )
    18561856            ) );
     
    18671867            'data'    => array(
    18681868                'message'  => $attachment_id->get_error_message(),
    1869                 'filename' => $_FILES['async-upload']['name'],
     1869                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    18701870            )
    18711871        ) );
Note: See TracChangeset for help on using the changeset viewer.