Make WordPress Core

Changeset 45970


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/3.7
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

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

    r25868 r45970  
    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.7/src/wp-admin/includes/ajax-actions.php

    r44857 r45970  
    16761676                'data'    => array(
    16771677                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    1678                     'filename' => $_FILES['async-upload']['name'],
     1678                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16791679                )
    16801680            ) );
     
    16911691            'data'    => array(
    16921692                'message'  => $attachment_id->get_error_message(),
    1693                 'filename' => $_FILES['async-upload']['name'],
     1693                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    16941694            )
    16951695        ) );
Note: See TracChangeset for help on using the changeset viewer.