Make WordPress Core


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

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

    r44848 r45948  
    20232023                        'data'    => array(
    20242024                                'message'  => __( 'Sorry, you are not allowed to upload files.' ),
    2025                                 'filename' => $_FILES['async-upload']['name'],
     2025                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20262026                        )
    20272027                ) );
    … …  
    20372037                                'data'    => array(
    20382038                                        'message'  => __( "You don't have permission to attach files to this post." ),
    2039                                         'filename' => $_FILES['async-upload']['name'],
     2039                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20402040                                )
    20412041                        ) );
    … …  
    20612061                                'data'    => array(
    20622062                                        'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    2063                                         'filename' => $_FILES['async-upload']['name'],
     2063                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20642064                                )
    20652065                        ) );
    … …  
    20762076                        'data'    => array(
    20772077                                'message'  => $attachment_id->get_error_message(),
    2078                                 'filename' => $_FILES['async-upload']['name'],
     2078                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20792079                        )
    20802080                ) );
Note: See TracChangeset for help on using the changeset viewer.