Make WordPress Core

Changeset 45650


Ignore:
Timestamp:
07/17/2019 01:10:59 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Administration: In admin-ajax.php, send X-Robots-Tag header earlier, so that it applies before wp_die() when no action parameter was provided.

Props robi-bobi, harryfear, garrett-eclipse.
Fixes #47711.

File:
1 edited

Legend:

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

    r45611 r45650  
    2525send_origin_headers();
    2626
     27header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
     28header( 'X-Robots-Tag: noindex' );
     29
    2730// Require an action parameter
    2831if ( empty( $_REQUEST['action'] ) ) {
     
    3538/** Load Ajax Handlers for WordPress Core */
    3639require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
    37 
    38 header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
    39 header( 'X-Robots-Tag: noindex' );
    4040
    4141send_nosniff_header();
Note: See TracChangeset for help on using the changeset viewer.