Make WordPress Core


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

    r44847 r45947  
    20092009            'data'    => array(
    20102010                'message'  => __( 'Sorry, you are not allowed to upload files.' ),
    2011                 'filename' => $_FILES['async-upload']['name'],
     2011                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20122012            )
    20132013        ) );
     
    20232023                'data'    => array(
    20242024                    'message'  => __( 'Sorry, you are not allowed to attach files to this post.' ),
    2025                     'filename' => $_FILES['async-upload']['name'],
     2025                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20262026                )
    20272027            ) );
     
    20472047                'data'    => array(
    20482048                    'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    2049                     'filename' => $_FILES['async-upload']['name'],
     2049                    'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20502050                )
    20512051            ) );
     
    20622062            'data'    => array(
    20632063                'message'  => $attachment_id->get_error_message(),
    2064                 'filename' => $_FILES['async-upload']['name'],
     2064                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20652065            )
    20662066        ) );
Note: See TracChangeset for help on using the changeset viewer.