Make WordPress Core


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

Escape the output in wp_ajax_upload_attachment().

Props whyisjake, sstoqnov.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r45934 r45936  
    25092509                                'data'    => array(
    25102510                                        'message'  => __( 'Sorry, you are not allowed to upload files.' ),
    2511                                         'filename' => $_FILES['async-upload']['name'],
     2511                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    25122512                                ),
    25132513                        )
     
    25262526                                        'data'    => array(
    25272527                                                'message'  => __( 'Sorry, you are not allowed to attach files to this post.' ),
    2528                                                 'filename' => $_FILES['async-upload']['name'],
     2528                                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    25292529                                        ),
    25302530                                )
     
    25532553                                        'data'    => array(
    25542554                                                'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    2555                                                 'filename' => $_FILES['async-upload']['name'],
     2555                                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    25562556                                        ),
    25572557                                )
     
    25702570                                'data'    => array(
    25712571                                        'message'  => $attachment_id->get_error_message(),
    2572                                         'filename' => $_FILES['async-upload']['name'],
     2572                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    25732573                                ),
    25742574                        )
Note: See TracChangeset for help on using the changeset viewer.