Make WordPress Core


Ignore:
Timestamp:
09/04/2019 04:30:11 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/src/wp-admin/includes/ajax-actions.php

    r44846 r45944  
    20662066                        'data'    => array(
    20672067                                'message'  => __( 'Sorry, you are not allowed to upload files.' ),
    2068                                 'filename' => $_FILES['async-upload']['name'],
     2068                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20692069                        )
    20702070                ) );
    … …  
    20802080                                'data'    => array(
    20812081                                        'message'  => __( 'Sorry, you are not allowed to attach files to this post.' ),
    2082                                         'filename' => $_FILES['async-upload']['name'],
     2082                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20832083                                )
    20842084                        ) );
    … …  
    21042104                                'data'    => array(
    21052105                                        'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    2106                                         'filename' => $_FILES['async-upload']['name'],
     2106                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    21072107                                )
    21082108                        ) );
    … …  
    21192119                        'data'    => array(
    21202120                                'message'  => $attachment_id->get_error_message(),
    2121                                 'filename' => $_FILES['async-upload']['name'],
     2121                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    21222122                        )
    21232123                ) );
Note: See TracChangeset for help on using the changeset viewer.