Make WordPress Core


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

Escape the output in wp_ajax_upload_attachment().

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

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

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

    r44850 r45951  
    19971997                        'data'    => array(
    19981998                                'message'  => __( 'You do not have permission to upload files.' ),
    1999                                 'filename' => $_FILES['async-upload']['name'],
     1999                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20002000                        )
    20012001                ) );
     
    20112011                                'data'    => array(
    20122012                                        'message'  => __( "You don't have permission to attach files to this post." ),
    2013                                         'filename' => $_FILES['async-upload']['name'],
     2013                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20142014                                )
    20152015                        ) );
     
    20352035                                'data'    => array(
    20362036                                        'message'  => __( 'The uploaded file is not a valid image. Please try again.' ),
    2037                                         'filename' => $_FILES['async-upload']['name'],
     2037                                        'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20382038                                )
    20392039                        ) );
     
    20502050                        'data'    => array(
    20512051                                'message'  => $attachment_id->get_error_message(),
    2052                                 'filename' => $_FILES['async-upload']['name'],
     2052                                'filename' => esc_html( $_FILES['async-upload']['name'] ),
    20532053                        )
    20542054                ) );
Note: See TracChangeset for help on using the changeset viewer.